Skip to content

Commit f1701a7

Browse files
committed
Multiarch support for Dockerfile
This PR consolidates the existing arch-specific Dockerfiles into only one file `Dockefile` to ease the code maintenance effort. Signed-off-by: Dennis Chen <[email protected]>
1 parent 0c01629 commit f1701a7

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

Dockerfile

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ FROM base AS criu
4444
# Install CRIU for checkpoint/restore support
4545
ENV CRIU_VERSION 3.6
4646
# Install dependancy packages specific to criu
47-
RUN apt-get update && apt-get install -y \
47+
RUN case $(uname -m) in \
48+
x86_64) \
49+
apt-get update && apt-get install -y \
4850
libnet-dev \
4951
libprotobuf-c0-dev \
5052
libprotobuf-dev \
@@ -57,7 +59,12 @@ RUN apt-get update && apt-get install -y \
5759
&& curl -sSL https://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
5860
&& cd /usr/src/criu \
5961
&& make \
60-
&& make PREFIX=/opt/criu install-criu
62+
&& make PREFIX=/opt/criu install-criu ;\
63+
;; \
64+
armv7l|aarch64|ppc64le|s390x) \
65+
mkdir -p /opt/criu; \
66+
;; \
67+
esac
6168

6269

6370
FROM base AS registry
@@ -73,9 +80,13 @@ RUN set -x \
7380
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
7481
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
7582
go build -buildmode=pie -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
76-
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
77-
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
78-
go build -buildmode=pie -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
83+
&& case $(uname -m) in \
84+
x86_64|ppc64le|s390x) \
85+
(cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1"); \
86+
GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH"; \
87+
go build -buildmode=pie -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry; \
88+
;; \
89+
esac \
7990
&& rm -rf "$GOPATH"
8091

8192

@@ -207,7 +218,7 @@ RUN apt-get update && apt-get install -y \
207218
libudev-dev \
208219
libsystemd-dev \
209220
binutils-mingw-w64 \
210-
g++-mingw-w64-x86-64 \
221+
g++-mingw-w64-x86-64 \
211222
net-tools \
212223
pigz \
213224
python-backports.ssl-match-hostname \

0 commit comments

Comments
 (0)