logic
- inspired by wzshiming
logic-of-container-image-mirror.png - references
- https://github.com/DaoCloud/crproxy
- https://docs.docker.com/docker-hub/mirror/
- https://github.com/twuni/docker-registry.helm
Less than 1 minute
diff -r live/ evil/
mkdir -p data
podman run --rm --name registry \
-p 5000:5000 \
-v $(pwd)/registry/data:/data \
-e REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/data \
-d docker.io/library/registry:2
blog
podman run --rm \
--entrypoint bash \
-it docker.io/minio/mc:latest \
-c "mc alias set minio http://host.containers.internal:9000 minioadmin minioadmin \
&& mc ls minio \
&& mc mb --ignore-existing minio/blog \
&& mc ls --recursive minio"
podman run --rm \
--name registry \
-p 5000:5000 \
-e REGISTRY_STORAGE=s3 \
-e REGISTRY_STORAGE_S3_ACCESSKEY=minioadmin \
-e REGISTRY_STORAGE_S3_SECRETKEY=minioadmin \
-e REGISTRY_STORAGE_S3_REGION=us-east-1 \
-e REGISTRY_STORAGE_S3_BUCKET=blog \
-e REGISTRY_STORAGE_S3_ROOTDIRECTORY=components/container-registry \
-e REGISTRY_STORAGE_S3_SECURE=false \
-e REGISTRY_STORAGE_S3_REGIONENDPOINT=http://host.containers.internal:9000 \
-e REGISTRY_STORAGE_S3_FORCEPATHSTYLE=true \
-d docker.io/library/registry:2
host.containers.internal
echo "127.0.0.1 host.containers.internal" >> /etc/hosts
blog
in ossOSS_ACCESS_KEY_ID=your_access_key_id
OSS_ACCESS_KEY_SECRET=your_access_key_secret
OSS_REGION=oss-cn-hangzhou
OSS_ENDPOINT=http://oss-cn-hangzhou-internal.aliyuncs.com
podman run --rm \
--name registry \
-p 5000:5000 \
-e REGISTRY_STORAGE=s3 \
-e REGISTRY_STORAGE_S3_ACCESSKEY=$OSS_ACCESS_KEY_ID \
-e REGISTRY_STORAGE_S3_SECRETKEY=$OSS_ACCESS_KEY_SECRET \
-e REGISTRY_STORAGE_S3_REGION=$OSS_REGION \
-e REGISTRY_STORAGE_S3_BUCKET=blog \
-e REGISTRY_STORAGE_S3_ROOTDIRECTORY=components/container-registry \
-e REGISTRY_STORAGE_S3_SECURE=true \
-e REGISTRY_STORAGE_S3_REGIONENDPOINT=$OSS_ENDPOINT \
-e REGISTRY_STORAGE_S3_FORCEPATHSTYLE=true \
-d docker.io/library/registry:2
podman pull docker.io/library/alpine:latest
podman tag docker.io/library/alpine:latest localhost:5000/alpine:latest
podman push --tls-verify=false localhost:5000/alpine:latest
podman image rm docker.io/library/alpine:latest localhost:5000/alpine:latest
podman pull --tls-verify=false localhost:5000/alpine:latest
podman run --rm --name registry -p 5000:5000 -d docker.io/library/registry:2
self-signed-ca-issuer
is ready