Created
March 24, 2018 00:40
-
-
Save erkolson/47d6fc1337975da0a80c231b5a5d43e8 to your computer and use it in GitHub Desktop.
Copy credentials into build container for git cloning, etc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM iron/go:dev as builder | |
ARG GH_TOKEN=default | |
RUN echo "machine github.com" > "/root/.netrc" \ | |
&& \ | |
echo "login x-oath-basic" >> "/root/.netrc" \ | |
&& \ | |
echo "password $GH_TOKEN" >> "/root/.netrc" \ | |
&& \ | |
chmod 600 /root/.netrc | |
# Do go get; go build, etc | |
# create deployment image | |
FROM alpine | |
RUN apk add --no-cache ca-certificates | |
COPY --from=builder path/to/binary /bin/binary | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment