Docker – (root) Additional property registry is not allowed
August 19, 2023 2023-08-19 5:11Docker – (root) Additional property registry is not allowed
Docker – (root) Additional property registry is not allowed
When I’m trying to execute the docker-compse.yaml file using the docker-compose command getting the error below (root) Additional property registry is not allowed see the command and error below,
$ docker-compse up -d
registry:
restart: always
image: registry:2
ports:
- 5000:5000
environment:
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.password
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
REGISTRY_STORAGE_DELETE_ENABLED: true
volumes:
- /registry:/var/lib/registry
- /var/lib/docker/auth:/auth
Need to add the services name and version so, the code changed to the valid format below,
version: '3'
services:
registry:
restart: always
image: registry:2
ports:
- 5000:5000
environment:
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.password
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /var/lib/registry
REGISTRY_STORAGE_DELETE_ENABLED: true
volumes:
- /registry:/var/lib/registry
- /var/lib/docker/auth:/auth
I hope, it should be working fine.