Last active
October 27, 2020 04:10
-
-
Save sshnaidm/07374e0c14ca52c50f7b2df6207a410a to your computer and use it in GitHub Desktop.
Podman to work with docker mirrors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# on client | |
cat << EOF >/etc/containers/registries.conf | |
unqualified-search-registries = ['docker.io'] | |
[[registry]] | |
prefix = "docker.io" | |
insecure = true | |
location = "docker.io" | |
[[registry.mirror]] | |
insecure = true | |
location = "192.168.2.69:5000" | |
EOF | |
# on 192.168.2.69 server: | |
# generate config | |
docker/podman run -it --rm --entrypoint cat registry:2 /etc/docker/registry/config.yml > `pwd`/config.yml | |
# add proxy config: | |
cat <<EOF >> config.yml | |
proxy: | |
remoteurl: https://registry-1.docker.io | |
EOF | |
# run proxy mirror | |
# with docker | |
docker run -d \ | |
-e REGISTRY_HTTP_ADDR=0.0.0.0:5000 \ | |
-v /home/ubuntu/imgs:/var/lib/registry \ | |
-v `pwd`/config.yml:/etc/docker/registry/config.yml \ | |
-p 5000:5000 \ | |
--name registry-test registry:2 | |
# with podman | |
podman run -d \ | |
-e REGISTRY_HTTP_ADDR=0.0.0.0:5000 \ | |
-v /home/ubuntu/imgs2:/var/lib/registry \ | |
-v `pwd`/config.yml:/etc/docker/registry/config.yml \ | |
-p 5000:5000 \ | |
--name registry-podman registry:2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment