mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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 <dennis.chen@arm.com>
This commit is contained in:
parent
0c01629e17
commit
f1701a741d
1 changed files with 17 additions and 6 deletions
21
Dockerfile
21
Dockerfile
|
@ -44,7 +44,9 @@ FROM base AS criu
|
||||||
# Install CRIU for checkpoint/restore support
|
# Install CRIU for checkpoint/restore support
|
||||||
ENV CRIU_VERSION 3.6
|
ENV CRIU_VERSION 3.6
|
||||||
# Install dependancy packages specific to criu
|
# Install dependancy packages specific to criu
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN case $(uname -m) in \
|
||||||
|
x86_64) \
|
||||||
|
apt-get update && apt-get install -y \
|
||||||
libnet-dev \
|
libnet-dev \
|
||||||
libprotobuf-c0-dev \
|
libprotobuf-c0-dev \
|
||||||
libprotobuf-dev \
|
libprotobuf-dev \
|
||||||
|
@ -57,7 +59,12 @@ RUN apt-get update && apt-get install -y \
|
||||||
&& curl -sSL https://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
|
&& curl -sSL https://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
|
||||||
&& cd /usr/src/criu \
|
&& cd /usr/src/criu \
|
||||||
&& make \
|
&& make \
|
||||||
&& make PREFIX=/opt/criu install-criu
|
&& make PREFIX=/opt/criu install-criu ;\
|
||||||
|
;; \
|
||||||
|
armv7l|aarch64|ppc64le|s390x) \
|
||||||
|
mkdir -p /opt/criu; \
|
||||||
|
;; \
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
FROM base AS registry
|
FROM base AS registry
|
||||||
|
@ -73,9 +80,13 @@ RUN set -x \
|
||||||
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
|
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
|
||||||
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
|
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
|
||||||
go build -buildmode=pie -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
|
go build -buildmode=pie -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
|
||||||
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
|
&& case $(uname -m) in \
|
||||||
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
|
x86_64|ppc64le|s390x) \
|
||||||
go build -buildmode=pie -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
|
(cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1"); \
|
||||||
|
GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH"; \
|
||||||
|
go build -buildmode=pie -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry; \
|
||||||
|
;; \
|
||||||
|
esac \
|
||||||
&& rm -rf "$GOPATH"
|
&& rm -rf "$GOPATH"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue