wohali commented on a change in pull request #60: Support multi-arch image 
building for couchdb docker image
URL: https://github.com/apache/couchdb-docker/pull/60#discussion_r162986157
 
 

 ##########
 File path: 2.1.1/Makefile
 ##########
 @@ -0,0 +1,49 @@
+# Licensed under the Apache License, Version 2.0 (the "License"); you may not
+# use this file except in compliance with the License. You may obtain a copy of
+# the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+.PHONY: build
+ARCH ?= amd64
+QEMUVERSION=v2.9.1
+TEMP_DIR:=$(shell mktemp -d)
+BUILD_IMAGE ?= couchdb-$(ARCH)
+
+
+ifeq ($(ARCH),amd64)
+       BASEIMAGE?=debian:jessie
+endif
+
+ifeq ($(ARCH),ppc64le)
+       BASEIMAGE?=ppc64le/debian:jessie
+        QEMUARCH=ppc64le
+endif
+
+build: 
+
+ifeq ($(ARCH),amd64)
+       # We just build it using the usual process.
+       docker build -t couchdb:2.1.1 .
+
+else
+       cp ./* $(TEMP_DIR)
+       cat Dockerfile.build \
+                       | sed "s|BASEIMAGE|$(BASEIMAGE)|g" \
+                | sed "s|ARCH|$(QEMUARCH)|g" \
+                > $(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.
 
 Review comment:
   Why is this so? How does this build process differ from the `amd64` one in 
which we presumably do need to run that command?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to