Closed dev-whoan closed 9 months ago
Check #192 #216
@joaopaulosr95 Thanks, but I already read the post.
I think since docker cred helper
is installed in manifest-tool
container image, my configuration should work and it doesn't.
You may need to add a --docker-cfg ~/.docker/config.json
flag before the push
command so it should call ecr-login properly. Also, are you running the manifest-tool
binary locally or are you using the official docker image mplatform/manifest-tool:alpine
?
Check this working example from one of my Gitlab repos that was set earlier today.
build:docker-merge-tags:
stage: build
image:
name: mplatform/manifest-tool:alpine
entrypoint: ["/bin/sh"]
parallel:
matrix:
- VARIANT: [gpu, cpu]
needs:
- job: build:docker
optional: true
script:
- echo "{\"credsStore\":\"ecr-login\"}" > config.json
- ARCH="linux/amd64"
- if [[ "${VARIANT}" == "gpu" ]]; then ARCH="$ARCH,linux/arm64"; fi
- manifest-tool --docker-cfg config.json push from-args --platforms "${ARCH}"
--template ${DOCKER_REGISTRY_URL}/${VAR_DOCKER_IMAGE}-${VARIANT}:ARCH-${RELEASE}
--target ${DOCKER_REGISTRY_URL}/${VAR_DOCKER_IMAGE}-${VARIANT}:${RELEASE}
- manifest-tool --docker-cfg config.json inspect ${DOCKER_REGISTRY_URL}/${VAR_DOCKER_IMAGE}-${VARIANT}:${RELEASE}
<<: *docker-rules
Please assume that both AWS_ACCESS_ID and AWS_SECRET_ACCESS_KEY are provided as environment variables to this example.
You may need to add a
--docker-cfg ~/.docker/config.json
flag before thepush
command so it should call ecr-login properly. Also, are you running themanifest-tool
binary locally or are you using the official docker imagemplatform/manifest-tool:alpine
?
lol what I missed that I thought root directory for the container runner user would be root
, so the ~/.docker/config.json
would be same as /root/.docker/config.json
I mounted it to /root/.docker/config.json
as default location, now it works.
Also I adding --docker-cfg ~/.docker/config.json
works.
Thanks @joaopaulosr95
Hello, I'm trying to use container image exists in my private aws ecr.
I tried with setting
~/.aws/credentials
using my aws credential, but it doesn't workalso I set
~/.docker/config.json
with following json:What I tried:
Is there any guide or usage for private registry?
Please help. Thank you.