-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix(docker): fix base image for multi-platform build #2099
Changes from all commits
cb6ff59
4fe7817
d0438a2
cfe4ae1
d517f72
3b30c40
77f6719
d94d281
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,21 +17,35 @@ RUN addgroup atlantis && \ | |
chmod g=u /home/atlantis/ && \ | ||
chmod g=u /etc/passwd | ||
|
||
# Install dumb-init, gosu and git-lfs. | ||
ENV DUMB_INIT_VERSION=1.2.5 | ||
# Install gosu and git-lfs. | ||
ENV GOSU_VERSION=1.14 | ||
ENV GIT_LFS_VERSION=3.1.2 | ||
RUN apk add --no-cache ca-certificates gnupg curl git unzip bash openssh libcap openssl && \ | ||
curl -L -s --output /bin/dumb-init "https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_x86_64" && \ | ||
chmod +x /bin/dumb-init && \ | ||
|
||
# Automatically populated with the architecture the image is being built for. | ||
ARG TARGETPLATFORM | ||
|
||
# Install packages needed for running Atlantis. | ||
RUN apk add --no-cache ca-certificates curl git unzip bash openssh libcap dumb-init && \ | ||
# Install packages needed for building dependencies. | ||
apk add --no-cache --virtual .build-deps gnupg openssl && \ | ||
mkdir -p /tmp/build && \ | ||
cd /tmp/build && \ | ||
curl -L -s --output git-lfs.tar.gz "https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-amd64-v${GIT_LFS_VERSION}.tar.gz" && \ | ||
|
||
# git-lfs | ||
curl -L -s --output git-lfs.tar.gz "https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-${TARGETPLATFORM##*/}-v${GIT_LFS_VERSION}.tar.gz" && \ | ||
tar -xf git-lfs.tar.gz && \ | ||
chmod +x git-lfs && \ | ||
mv git-lfs /usr/bin/git-lfs && \ | ||
curl -L -s --output gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64" && \ | ||
curl -L -s --output gosu.asc "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64.asc" && \ | ||
git-lfs --version && \ | ||
|
||
# gosu | ||
case ${TARGETPLATFORM} in \ | ||
"linux/amd64") GOSU_ARCH=amd64 ;; \ | ||
"linux/arm64") GOSU_ARCH=arm64 ;; \ | ||
"linux/arm/v7") GOSU_ARCH=armhf ;; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would this Looks like the image does not get built. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have a lot of experience with the I'm guessing it's compatible with an ARMv7 architecture, but I don't have a way of testing that myself, so this is a bit of an opportunistic guess, although I hadn't seen how the files were built before this, and I just saw there was binaries available on the releases page. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, I think we might need to try it ourselves. As you can see in here, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In any case, I doubt it's any more wrong than using the binary for amd64 :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haha, that is true. |
||
esac && \ | ||
curl -L -s --output gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${GOSU_ARCH}" && \ | ||
curl -L -s --output gosu.asc "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${GOSU_ARCH}.asc" && \ | ||
for server in $(shuf -e ipv4.pool.sks-keyservers.net \ | ||
hkp://p80.pool.sks-keyservers.net:80 \ | ||
keyserver.ubuntu.com \ | ||
|
@@ -42,13 +56,15 @@ RUN apk add --no-cache ca-certificates gnupg curl git unzip bash openssh libcap | |
gpg --batch --verify gosu.asc gosu && \ | ||
chmod +x gosu && \ | ||
cp gosu /bin && \ | ||
cd /tmp && \ | ||
rm -rf /tmp/build && \ | ||
gpgconf --kill dirmngr && \ | ||
gpgconf --kill gpg-agent && \ | ||
apk del gnupg openssl && \ | ||
rm -rf /root/.gnupg && \ | ||
rm -rf /var/cache/apk/* | ||
gosu --version && \ | ||
|
||
# Cleanup | ||
cd /tmp && \ | ||
rm -rf /tmp/build && \ | ||
gpgconf --kill dirmngr && \ | ||
gpgconf --kill gpg-agent && \ | ||
apk del .build-deps && \ | ||
rm -rf /root/.gnupg | ||
|
||
# Set up nsswitch.conf for Go's "netgo" implementation | ||
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call 👍