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
|
||||
RUN apk --no-cache add apache2-utils
|
||||
|
||||
# Create config file with minimal configuration
|
||||
RUN mkdir -p /etc/docker/registry && \
|
||||
echo 'version: 0.1' > /etc/docker/registry/config.yml && \
|
||||
echo 'storage:' >> /etc/docker/registry/config.yml && \
|
||||
echo ' filesystem:' >> /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
|
||||
# Create config directory
|
||||
RUN mkdir -p /etc/docker/registry
|
||||
|
||||
# Create config file with proper YAML formatting
|
||||
RUN printf "version: 0.1\nstorage:\n filesystem:\n rootdirectory: /var/lib/registry\nhttp:\n addr: :5000\n" > /etc/docker/registry/config.yml
|
||||
@@ -11,6 +11,7 @@ services:
|
||||
- registry-data:/var/lib/registry
|
||||
networks:
|
||||
- registry-network
|
||||
command: ["/etc/docker/registry/config.yml"]
|
||||
|
||||
networks:
|
||||
registry-network:
|
||||
|
||||
Reference in New Issue
Block a user