-
Notifications
You must be signed in to change notification settings - Fork 136
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
Support multi-arch image building for couchdb docker image #60
Conversation
bea995f
to
066b0b7
Compare
This commit introduces a way by which we can now build multi-arch docker images for couchdb. Some of this work is inspired from the https://github.com/kubernetes/kubernetes/tree/master/build/debian-base This is the first cut and it can be enhanced based on the couchdb community's preference. This image is required atleast for the openwhisk project where we are driving the multi-arch support. Usage: `make build` ==> Retains the old behavior of builds `make build ARCH=ppc64le` ==> Builds it for a specific arch Travis file is updated to use `make` instead of docker commandline to do the builds.
066b0b7
to
000f83c
Compare
@wohali Hi, it would be great to have multi-arch manifest images of couchdb on dockerhub. This PR helps in building the multi-arch couchdb image for |
Hi @sudswas , thanks for the submission and the pull request! I appreciate the enthusiasm and interest in our project very much. Welcome, from a sister Apache project! I think this work is premature for CouchDB until these platforms are added to our regular CouchDB CI workflow in Travis and/or Jenkins. If you look at these links (1, 2, 3) you'll see that there have been multiple issues on some of the non-Intel platforms. FYI, we don't and shouldn't use this repository for our CI work; building the Docker images shouldn't always include running the full test suite as well. If you are interested in helping us get regular CI work going on additional platforms, and helping fix the bugs that are found, we'd very much welcome the support! 💃 Travis for the main repo is here: https://github.com/apache/couchdb/blob/master/.travis.yml We'd like to solve the HW problem as much as possible on real hardware, as preferentially suggested in the official-images ticket by Docker project leadership. Apache Jenkins appears to now have an As I have no objections to the approach you've taken, I'm going to leave the PR open until we get these other issues resolved. Thanks again for your help! |
2.1.1/Dockerfile.build
Outdated
FROM BASEIMAGE | ||
MAINTAINER CouchDB Developers dev@couchdb.apache.org | ||
|
||
CROSS_BUILD_COPY qemu-ARCH-static /usr/bin/ |
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.
Since this is a cross build file, perhaps a more informative filename than Dockerfile.build
should be used. Perhaps Dockerfile.crossbuild
?
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.
Yeah makes sense. Done.
2.1.1/Dockerfile.build
Outdated
@@ -0,0 +1,128 @@ | |||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not |
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 am concerned about this file falling out of sync with the main Dockerfile
. Is it possible to generate all images from the same file?
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 took care of it. Basically now everything should get done via one file only.
2.1.1/Makefile
Outdated
> $(TEMP_DIR)/Dockerfile.build | ||
docker run --rm --privileged multiarch/qemu-user-static:register --reset | ||
curl -sSL https://github.com/multiarch/qemu-user-static/releases/download/$(QEMUVERSION)/x86_64_qemu-$(QEMUARCH)-static.tar.gz | tar -xz -C $(TEMP_DIR) | ||
# This gosu command is not necessary to run when we are building the image. Hence drop it. |
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.
Why is this so? How does this build process differ from the amd64
one in which we presumably do need to run that command?
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.
Well so - the qemu emulator isn't quite perfect w.r.t gosu. While it's able to build gosu, running a gosu command does not work. I thought since this command is not doing anything much, we might as well drop it.
I realized I didn't reply to the |
Thanks a lot @wohali for the quick review. |
HI there, I saw the JIRA request has been closed and the I'll work on adding Update: Jenkins is blocked for other reasons (tests failing) so this work is blocked until Jenkins is all green again. @jiangphcn has said that he may be able to assist, but holidays start soon for him. If you are able to help diagnose and resolve these failures at all, that'd be most useful. |
Raised a new PR as the continuation of this work because the author of this issue is unable to complete this work.. Please follow this PR: #84 for the continuation of this work. |
It would be great if someone from maintainers can close this PR. |
Closed in favour of #84 . |
This commit introduces a way by which we can now build multi-arch
docker images for couchdb. Some of this work is inspired from the
https://github.com/kubernetes/kubernetes/tree/master/build/debian-base
This is the first cut and it can be enhanced based on the couchdb
community's preference. This image is required atleast for the
openwhisk project where we are driving the multi-arch support.
Overview
This PR tries to aid multi-arch builds for couchdb docker image. A makefile is introduce to allow the users to choose an architecture to build the docker image on. No changes are done for the default case that exists today. This uses the qemu static emulator to do the required work.
The README changes are not updated as a part of this PR.
Testing recommendations
Build it for all different architectures by specifying the ARCH parameter during make build.
Checklist