fix: proper YAML config with printf
- Use printf for proper YAML formatting - Add explicit config path to command - Add config directory creation step
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -3,11 +3,8 @@ FROM registry:2
|
|||||||
# Use Alpine's apk package manager to install apache2-utils
|
# Use Alpine's apk package manager to install apache2-utils
|
||||||
RUN apk --no-cache add apache2-utils
|
RUN apk --no-cache add apache2-utils
|
||||||
|
|
||||||
# Create config file with minimal configuration
|
# Create config directory
|
||||||
RUN mkdir -p /etc/docker/registry && \
|
RUN mkdir -p /etc/docker/registry
|
||||||
echo 'version: 0.1' > /etc/docker/registry/config.yml && \
|
|
||||||
echo 'storage:' >> /etc/docker/registry/config.yml && \
|
# Create config file with proper YAML formatting
|
||||||
echo ' filesystem:' >> /etc/docker/registry/config.yml && \
|
RUN printf "version: 0.1\nstorage:\n filesystem:\n rootdirectory: /var/lib/registry\nhttp:\n addr: :5000\n" > /etc/docker/registry/config.yml
|
||||||
echo ' rootdirectory: /var/lib/registry' >> /etc/docker/registry/config.yml && \
|
|
||||||
echo 'http:' >> /etc/docker/registry/config.yml && \
|
|
||||||
echo ' addr: :5000' >> /etc/docker/registry/config.yml
|
|
||||||
@@ -11,6 +11,7 @@ services:
|
|||||||
- registry-data:/var/lib/registry
|
- registry-data:/var/lib/registry
|
||||||
networks:
|
networks:
|
||||||
- registry-network
|
- registry-network
|
||||||
|
command: ["/etc/docker/registry/config.yml"]
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
registry-network:
|
registry-network:
|
||||||
|
|||||||
Reference in New Issue
Block a user