A

Docker registry ubuntu

public
andrei.k Mar 25, 2024 Never 26
Clone
Bash paste1.bash 21 lines (19 loc) | 977 Bytes
1
apt-get update
2
cd /home/
3
apt-get install letsencrypt
4
systemctl status certbot.timer
5
letsencrypt certonly --standalone --email [email protected] -d registry.domain.com
6
cd /etc/letsencrypt/live/registry.domain.com/
7
cp privkey.pem domain.key
8
cat cert.pem chain.pem > domain.crt
9
chmod 777 domain.key domain.crt
10
sudo apt-get update
11
12
--- install docker
13
https://docs.docker.com/engine/install/ubuntu/
14
--- install docker
15
16
docker ps
17
mkdir /home/auth
18
nano /home/auth/htpasswd
19
docker run --entrypoint htpasswd httpd:2 -Bbn login password > auth/htpasswd
20
docker run -d -p 443:5000 --restart=always --name registry -v /etc/letsencrypt/live/registry.domain.com:/certs -v /opt/docker-registry:/var/lib/registry -v `pwd`/auth:/auth -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Axway Docker Registry" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key registry:2
21
docker ps