The htpasswd file path corrected
Some checks are pending
CI/CD Pipeline / Test Backend (push) Waiting to run
CI/CD Pipeline / Test Frontend (push) Waiting to run
CI/CD Pipeline / Build and Push Docker Images (push) Blocked by required conditions
CI/CD Pipeline / Deploy to Production (push) Blocked by required conditions

This commit is contained in:
continuist 2025-06-28 14:04:28 -04:00
parent a4ef13b5dd
commit 0d9a943f66

View file

@ -464,7 +464,7 @@ http:
auth: auth:
htpasswd: htpasswd:
realm: basic-realm realm: basic-realm
path: /etc/docker/registry/auth.htpasswd path: /etc/docker/registry/auth/auth.htpasswd
health: health:
storagedriver: storagedriver:
enabled: true enabled: true
@ -492,10 +492,10 @@ sudo su - SERVICE_USER
# Create htpasswd file for authentication (required for push operations) # Create htpasswd file for authentication (required for push operations)
mkdir -p /opt/registry/auth mkdir -p /opt/registry/auth
htpasswd -Bbn push-user "$(openssl rand -base64 32)" > /opt/registry/auth.htpasswd htpasswd -Bbn push-user "$(openssl rand -base64 32)" > /opt/registry/auth/auth.htpasswd
# Create a read-only user (optional, for additional security) # Create a read-only user (optional, for additional security)
htpasswd -Bbn read-user "$(openssl rand -base64 32)" >> /opt/registry/auth.htpasswd htpasswd -Bbn read-user "$(openssl rand -base64 32)" >> /opt/registry/auth/auth.htpasswd
# Exit SERVICE_USER shell # Exit SERVICE_USER shell
exit exit
@ -523,7 +523,7 @@ services:
- "5000:5000" - "5000:5000"
volumes: volumes:
- ./config.yml:/etc/docker/registry/config.yml:ro - ./config.yml:/etc/docker/registry/config.yml:ro
- ./auth.htpasswd:/etc/docker/registry/auth.htpasswd:ro - ./auth/auth.htpasswd:/etc/docker/registry/auth/auth.htpasswd:ro
- registry_data:/var/lib/registry - registry_data:/var/lib/registry
restart: unless-stopped restart: unless-stopped
networks: networks:
@ -636,7 +636,7 @@ exit
```bash ```bash
# Get the push user credentials # Get the push user credentials
PUSH_USER="push-user" PUSH_USER="push-user"
PUSH_PASSWORD=$(grep push-user /opt/registry/auth.htpasswd | cut -d: -f2) PUSH_PASSWORD=$(grep push-user /opt/registry/auth/auth.htpasswd | cut -d: -f2)
sudo tee /etc/docker/daemon.json << EOF sudo tee /etc/docker/daemon.json << EOF
{ {