container-transform icon indicating copy to clipboard operation
container-transform copied to clipboard

Support the ':Z' access option for volumes

Open TLATER opened this issue 6 years ago • 0 comments

When passing the following:

version: "3"

services:
  local-registry:
    name: local-registry
    image: registry
    environment:
      REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
      REGISTRY_PROXY_REMOTEURL: https://registry-1.docker.io
    ports:
      - "127.0.0.1:5000:5000"
    networks:
      - docker-registry
    volumes:
      - "docker-registry:/var/lib/registry:Z"

networks:
  docker-registry:
    external: true

volumes:
  docker-registry:

I get:

# local-registry.service #######################################################################
[Unit]
Description=Local-Registry
After=docker.service 
Requires=docker.service 

[Service]
ExecStartPre=-/usr/bin/docker kill local-registry
ExecStartPre=-/usr/bin/docker rm local-registry
ExecStartPre=/usr/bin/docker pull registry
ExecStart=/usr/bin/docker run \
    --name local-registry \
    -p 127.0.0.1:5000:5000 \
    --net ['docker-registry'] \
    -e "REGISTRY_PROXY_REMOTEURL=https://registry-1.docker.io" \
    -e "REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/var/lib/registry" \
    registry 
ExecStop=/usr/bin/docker stop local-registry

Removing the :Z option makes the volume flag appear again. Some quick code-diving suggests that the :z and :Z options are completely ignored - a little unfortunate, I use selinux :|

TLATER avatar Jul 15 '18 22:07 TLATER