-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
*: add multi-arch support in release binaries #7714
Conversation
|
||
for TARGET_ARCH in "amd64" "arm64" "ppc64le"; do | ||
echo Building ${TARGET_ARCH} docker image... | ||
GOARCH=${TARGET_ARCH} BINARYDIR=release/etcd-${VERSION}-linux-${TARGET_ARCH} BUILDDIR=release ./scripts/build-docker ${VERSION} |
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.
I was under the impression it's not possible to build docker images on a mismatched architecture. Does this work because the Dockerfile doesn't use RUN
?
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.
Yes, if the Dockerfile just uses ADD it works. If we want to use RUN, then I think we could setup QEMU user emulation to do that, but that is significantly more complicated and would add to the requirements of the host.
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.
OK, great! glad it's possible to avoid that whole qemu mess
7d9bf35
to
e6ccf76
Compare
Rebased to latest, renamed patch to satisfy travis-ci check. |
All the CI stuff passed except the jenkins-proxy-ci with |
Documentation/v2/dev/release.md
Outdated
@@ -70,7 +70,7 @@ cd release | |||
# personal GPG is okay for now | |||
for i in etcd-*{.zip,.tar.gz}; do gpg --sign ${i}; done | |||
# use `CoreOS ACI Builder <release@coreos.com>` secret key | |||
gpg -u 88182190 -a --output etcd-${VERSION}-linux-amd64.aci.asc --detach-sig etcd-${VERSION}-linux-amd64.aci | |||
gpg -u 88182190 -a --output etcd-${VERSION}-linux-${arch}.aci.asc --detach-sig etcd-${VERSION}-linux-${arch}.aci |
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.
for aci in etcd-${VERSION}.*.aci; do gpg -u 88182190 -a --output ${aci}.asc --detach-sig ${aci}; done
?
@@ -24,17 +27,18 @@ fi | |||
|
|||
if [ ${ARCH} != "amd64" ]; then | |||
DOCKERFILE+=".${ARCH}" | |||
TAG+="-${ARCH}" | |||
VERSION+="-${ARCH}" |
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.
Is this the usual way to do multi arch? Won't this break ${TAG}:latest?
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.
I was following the presence set by flannel: https://quay.io/repository/coreos/flannel?tab=tags
I guess then we could have ${TAG}:latest-${arch}
.
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.
OK
EXPOSE 2379 2380 | ||
|
||
# Define default command. | ||
CMD ["/usr/local/bin/etcd"] |
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.
should this be tagged as arm64
or aarch64
? is there an official convention yet?
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.
It is totally open.
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.
OK
e6ccf76
to
008bb55
Compare
Rebased to latest, added |
lgtm, but maybe squash some of the build-docker patches if possible? Thanks! |
008bb55
to
397e50e
Compare
Squashed build-docker patches into |
Codecov Report
@@ Coverage Diff @@
## master #7714 +/- ##
========================================
Coverage ? 75.9%
========================================
Files ? 331
Lines ? 25998
Branches ? 0
========================================
Hits ? 19733
Misses ? 4845
Partials ? 1420 Continue to review full report at Codecov.
|
Signed-off-by: Geoff Levand <geoff@infradead.org>
Uses GOARCH to build for a targeted arch. Usage: GOARCH=... BINARYDIR=... BUILDDIR=... ./scripts/build-aci version Signed-off-by: Geoff Levand <geoff@infradead.org>
o Set -e to abort script if a command fails. o Allow custom docker 'TAG' from the environment. o Move arch suffix to version to allow all images to be put into a single repository. o Enable cross builds. When doing cross builds where the host and target architectures are different 'RUN mkdir' will fail since the target container cannot be run on the host. To work around this, create the directories in build-docker, then use ADD in the Dockerfile. o Add Dockerfile-release.arm64 Signed-off-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
397e50e
to
bf98718
Compare
Rebased to latest. Is there anything else this needs to be merged? |
/cc @xiang90 |
LGTM |
No description provided.