docker buildx bake --file docker-bake.hclcp .env.sample .env
vim .envdocker run --name openresty_docker_registry_proxy \
--rm -it \
-p 3128:3128 \
-v $(pwd)/docker_mirror_cache:/docker_mirror_cache \
-v $(pwd)/certs:/certs \
--env-file .env \
docker-registry-proxy-cache:latestdocker compose upThe HTPASSWD environment variable activates basic authentication. In this example, we define two users:
- user1:user1
- user2:user2
The HTPASSWD_DELIMITER environment variable can be used to specify a custom delimiter. By default, a space is used.
By default, generate-certificate.sh generates a self-signed certificate. You can override this by mounting a volume with your own certificates at /certs.
- server.crt
- server.key
{
...
"proxies": {
"http-proxy": "http://user1:[email protected]:3128",
"https-proxy": "http://user1:[email protected]:3128"
},
"insecure-registries" : ["own-registry.sample.com:443"]
}The insecure-registries setting should be configured if your proxy is using an invalid or self-signed certificate.