Let's start by deploying a docker registry (without authentication), the artifact registry and an alpine based client to test it:
version: '3.7'
services:
registry:
image: registry:2
artifact-registry:
container_name: artifact-registry
image: linkacloud/artifact-registry:dev
environment:
ARTIFACT_REGISTRY_AES_KEY: "noop"
command:
- --backend=registry:5000
- --no-https
ports:
- "9887:9887"
artifact-registry-client:
container_name: artifact-registry-client
image: linkacloud/artifact-registry:dev
init: true
entrypoint: ["/bin/sh", "-c"]
command:
- sleep infinity
curl https://raw.githubusercontent.com/linka-cloud/artifact-registry/main/docker-compose.yaml | docker compose -f - up -d
Now, let's get some packages:
docker exec -it artifact-registry-client sh -c "apk fetch --no-cache -o /tmp -R curl jq"
Upload them to the registry:
docker exec -it artifact-registry-client sh -c "find /tmp -name '*.apk' -exec lkar apk push --plain-http artifact-registry:9887/test v3.18 main {} \;"
# remove any existing apk repository and cache
docker exec -it artifact-registry-client sh -c "rm -rf /tmp/* && rm -rf /var/cache/apk/* && rm -rf /etc/apk/repositories"
docker exec -it artifact-registry-client sh -c "lkar apk setup --plain-http artifact-registry:9887/test v3.18 main"
And finally, install the packages:
docker exec -it artifact-registry-client sh -c "apk add --no-cache curl jq"
curl https://raw.githubusercontent.com/linka-cloud/artifact-registry/main/docker-compose.yaml | docker compose -f - down --volumes --remove-orphans