Open ishwinder opened 1 year ago
Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏
If it helps, my Dockerfile is this:
FROM golang:1.16 as ecr-helper
ENV CGO_ENABLED 0
ENV GO111MODULE off
ENV REPO github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login
RUN go get -u $REPO && \
rm /go/bin/docker-credential-ecr-login && \
go build \
-o /go/bin/docker-credential-ecr-login \
/go/src/$REPO
WORKDIR /go/bin/
FROM containrrr/watchtower:latest
ENV HOME='/'
ENV PATH="{$PATH}:/go/bin"
ENV AWS_REGION='eu-central-1'
COPY --from=ecr-helper /go/bin /go/bin
@zoispag thanks for taking a look, let me try this.
Seems like the same issue, not sure how its different from explicitly mounting the binary as shown in the documentation
docker run -d --rm --name aws-cred-helper \
--volume helper:/go/bin aws-ecr-dock-cred-helper
Finally got this working with ECR
I followed all the steps from watchtower docs, but using the Dockerfile of @zoispag just changing version of golang to 1.19
My watchtower docker-compose.yml
version: "3.4"
volumes:
helper:
external: true
services:
watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/ec2-user/.docker/config.json:/config.json
- /home/ec2-user/.aws:/.aws
- helper:/go/bin
environment:
HOME: /
PATH: $PATH:/go/bin
AWS_REGION: "us-east-1"
WATCHTOWER_CLEANUP: "true"
WATCHTOWER_INCLUDE_RESTARTING: "true"
WATCHTOWER_INCLUDE_STOPPED: "true"
WATCHTOWER_SCHEDULE: 0 0 0 * * *
TZ: America/Sao_Paulo
restart: always
Hey @Rubens-Gasparotto
what are you using to authorize against ECR, if you want to pull and start a container the first time?
Describe the bug
I have been trying to get this working with amazon ecr but somehow it doesn't use the helper with ecr.
my docker-compose.yml
The helper volume Dockerfile is a copy paste from documentation here .. https://containrrr.dev/watchtower/private-registries/
Appreciate any help in this regard.
Steps to reproduce
Expected behavior
watchtower should be able to use the docker-credentials helper to login to the ecr
Screenshots
No response
Environment
Your logs
Additional context
I think the problem is this line time="2023-03-01T14:05:04Z" level=debug msg="Loaded auth credentials for user , on registry:latest, from file /config.json", here its not able to find the username