The htpasswd file path corrected
Some checks are pending
Some checks are pending
This commit is contained in:
parent
a4ef13b5dd
commit
0d9a943f66
1 changed files with 5 additions and 5 deletions
|
@ -464,7 +464,7 @@ http:
|
|||
auth:
|
||||
htpasswd:
|
||||
realm: basic-realm
|
||||
path: /etc/docker/registry/auth.htpasswd
|
||||
path: /etc/docker/registry/auth/auth.htpasswd
|
||||
health:
|
||||
storagedriver:
|
||||
enabled: true
|
||||
|
@ -492,10 +492,10 @@ sudo su - SERVICE_USER
|
|||
|
||||
# Create htpasswd file for authentication (required for push operations)
|
||||
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)
|
||||
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
|
||||
|
@ -523,7 +523,7 @@ services:
|
|||
- "5000:5000"
|
||||
volumes:
|
||||
- ./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
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
|
@ -636,7 +636,7 @@ exit
|
|||
```bash
|
||||
# Get the push user credentials
|
||||
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
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue