Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update Dockerfile to use Go modules and go install #2002

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions docs/private-registries.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,21 @@ in a volume that may be mounted onto your watchtower container.
1. Create the Dockerfile (contents below):
```Dockerfile
FROM golang:1.20

ENV GO111MODULE off
ENV CGO_ENABLED 0
ENV REPO github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login

RUN go get -u $REPO

RUN rm /go/bin/docker-credential-ecr-login

RUN go build \
-o /go/bin/docker-credential-ecr-login \
/go/src/$REPO


# Enable Go modules and disable CGO
ENV GO111MODULE=on
ENV CGO_ENABLED=0
# Define the repository to install from
ENV REPO=github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login@latest

# Install the necessary dependencies and build the binary
RUN go install $REPO

# Set the final working directory
WORKDIR /go/bin/

# Set the default command
CMD ["docker-credential-ecr-login"]
```

2. Use the following commands to build the aws-ecr-dock-cred-helper and store it's output in a volume:
Expand Down