2016-01-15 09:25:03 -05:00
|
|
|
# This file describes the standard way to build Docker on aarch64, using docker
|
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
#
|
|
|
|
# # Assemble the full dev environment. This is slow the first time.
|
|
|
|
# docker build -t docker -f Dockerfile.aarch64 .
|
|
|
|
#
|
|
|
|
# # Mount your source in an interactive container for quick testing:
|
|
|
|
# docker run -v `pwd`:/go/src/github.com/docker/docker --privileged -i -t docker bash
|
|
|
|
#
|
|
|
|
# # Run the test suite:
|
2016-07-04 10:43:53 -04:00
|
|
|
# docker run --privileged docker hack/make.sh test-unit test-integration-cli test-docker-py
|
2016-01-15 09:25:03 -05:00
|
|
|
#
|
|
|
|
# Note: AppArmor used to mess with privileged mode, but this is no longer
|
|
|
|
# the case. Therefore, you don't have to disable it anymore.
|
|
|
|
#
|
|
|
|
|
2016-02-15 05:11:10 -05:00
|
|
|
FROM aarch64/ubuntu:wily
|
2016-01-15 09:25:03 -05:00
|
|
|
|
|
|
|
# Packaged dependencies
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
apparmor \
|
|
|
|
aufs-tools \
|
|
|
|
automake \
|
|
|
|
bash-completion \
|
|
|
|
btrfs-tools \
|
|
|
|
build-essential \
|
|
|
|
createrepo \
|
|
|
|
curl \
|
|
|
|
dpkg-sig \
|
|
|
|
g++ \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
iptables \
|
|
|
|
jq \
|
|
|
|
libapparmor-dev \
|
|
|
|
libc6-dev \
|
|
|
|
libcap-dev \
|
2016-07-07 08:02:19 -04:00
|
|
|
libltdl-dev \
|
2016-01-15 09:25:03 -05:00
|
|
|
libsqlite3-dev \
|
2016-02-15 05:11:10 -05:00
|
|
|
libsystemd-dev \
|
2016-01-15 09:25:03 -05:00
|
|
|
mercurial \
|
2016-02-12 11:56:11 -05:00
|
|
|
net-tools \
|
2016-01-15 09:25:03 -05:00
|
|
|
parallel \
|
|
|
|
pkg-config \
|
|
|
|
python-dev \
|
|
|
|
python-mock \
|
|
|
|
python-pip \
|
|
|
|
python-websocket \
|
2016-02-15 05:11:10 -05:00
|
|
|
gccgo \
|
2016-07-06 12:48:51 -04:00
|
|
|
iproute2 \
|
|
|
|
iputils-ping \
|
2016-01-15 09:25:03 -05:00
|
|
|
--no-install-recommends
|
|
|
|
|
|
|
|
# Install armhf loader to use armv6 binaries on armv8
|
|
|
|
RUN dpkg --add-architecture armhf \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get install -y libc6:armhf
|
|
|
|
|
|
|
|
# Get lvm2 source for compiling statically
|
|
|
|
ENV LVM2_VERSION 2.02.103
|
|
|
|
RUN mkdir -p /usr/local/lvm2 \
|
|
|
|
&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
|
|
|
|
| tar -xzC /usr/local/lvm2 --strip-components=1
|
|
|
|
# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
|
|
|
|
|
|
|
|
# fix platform enablement in lvm2 to support aarch64 properly
|
|
|
|
RUN set -e \
|
|
|
|
&& for f in config.guess config.sub; do \
|
|
|
|
curl -fsSL -o "/usr/local/lvm2/autoconf/$f" "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$f;hb=HEAD"; \
|
|
|
|
done
|
|
|
|
# "arch.c:78:2: error: #error the arch code needs to know about your machine type"
|
|
|
|
|
|
|
|
# Compile and install lvm2
|
|
|
|
RUN cd /usr/local/lvm2 \
|
|
|
|
&& ./configure \
|
|
|
|
--build="$(gcc -print-multiarch)" \
|
|
|
|
--enable-static_link \
|
|
|
|
&& make device-mapper \
|
|
|
|
&& make install_device-mapper
|
|
|
|
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
|
|
|
|
|
2016-02-03 07:09:52 -05:00
|
|
|
# install seccomp: the version shipped in trusty is too old
|
2016-05-24 16:39:52 -04:00
|
|
|
ENV SECCOMP_VERSION 2.3.1
|
2016-02-03 07:09:52 -05:00
|
|
|
RUN set -x \
|
|
|
|
&& export SECCOMP_PATH="$(mktemp -d)" \
|
|
|
|
&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
|
|
|
|
| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
|
|
|
|
&& ( \
|
|
|
|
cd "$SECCOMP_PATH" \
|
|
|
|
&& ./configure --prefix=/usr/local \
|
|
|
|
&& make \
|
|
|
|
&& make install \
|
|
|
|
&& ldconfig \
|
|
|
|
) \
|
|
|
|
&& rm -rf "$SECCOMP_PATH"
|
|
|
|
|
2016-01-15 09:25:03 -05:00
|
|
|
# Install Go
|
|
|
|
# We don't have official binary tarballs for ARM64, eigher for Go or bootstrap,
|
2016-06-28 02:31:34 -04:00
|
|
|
# so we use gccgo as bootstrap to build Go from source code.
|
|
|
|
# We don't use the official ARMv6 released binaries as a GOROOT_BOOTSTRAP, because
|
|
|
|
# not all ARM64 platforms support 32-bit mode. 32-bit mode is optional for ARMv8.
|
2016-09-07 17:42:35 -04:00
|
|
|
ENV GO_VERSION 1.7.1
|
2016-02-15 05:11:10 -05:00
|
|
|
RUN mkdir /usr/src/go && curl -fsSL https://storage.googleapis.com/golang/go${GO_VERSION}.src.tar.gz | tar -v -C /usr/src/go -xz --strip-components=1 \
|
2016-01-15 09:25:03 -05:00
|
|
|
&& cd /usr/src/go/src \
|
2016-02-15 05:11:10 -05:00
|
|
|
&& GOOS=linux GOARCH=arm64 GOROOT_BOOTSTRAP="$(go env GOROOT)" ./make.bash
|
|
|
|
|
2016-01-15 09:25:03 -05:00
|
|
|
ENV PATH /usr/src/go/bin:$PATH
|
|
|
|
ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
|
|
|
|
|
2016-02-03 07:09:52 -05:00
|
|
|
# Only install one version of the registry, because old version which support
|
|
|
|
# schema1 manifests is not working on ARM64, we should skip integration-cli
|
|
|
|
# tests for schema1 manifests on ARM64.
|
|
|
|
ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
|
2016-01-15 09:25:03 -05:00
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
|
|
|
&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
|
|
|
|
&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
|
|
|
|
&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
|
|
|
|
go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
|
|
|
|
&& rm -rf "$GOPATH"
|
|
|
|
|
2016-04-29 04:59:19 -04:00
|
|
|
# Install notary and notary-server
|
2016-05-11 18:25:05 -04:00
|
|
|
ENV NOTARY_VERSION v0.3.0
|
2016-01-15 09:25:03 -05:00
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
|
|
|
&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
|
2016-01-26 14:51:22 -05:00
|
|
|
&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
|
2016-03-24 18:41:34 -04:00
|
|
|
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
|
2016-01-15 09:25:03 -05:00
|
|
|
go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
|
2016-03-24 18:41:34 -04:00
|
|
|
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
|
2016-02-03 07:09:52 -05:00
|
|
|
go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
|
2016-01-15 09:25:03 -05:00
|
|
|
&& rm -rf "$GOPATH"
|
|
|
|
|
|
|
|
# Get the "docker-py" source so we can run their integration tests
|
2016-08-16 14:48:48 -04:00
|
|
|
ENV DOCKER_PY_COMMIT e2655f658408f9ad1f62abdef3eb6ed43c0cf324
|
2016-01-15 09:25:03 -05:00
|
|
|
RUN git clone https://github.com/docker/docker-py.git /docker-py \
|
|
|
|
&& cd /docker-py \
|
|
|
|
&& git checkout -q $DOCKER_PY_COMMIT \
|
|
|
|
&& pip install -r test-requirements.txt
|
|
|
|
|
|
|
|
# Set user.email so crosbymichael's in-container merge commits go smoothly
|
|
|
|
RUN git config --global user.email 'docker-dummy@example.com'
|
|
|
|
|
|
|
|
# Add an unprivileged user to be used for tests which need it
|
|
|
|
RUN groupadd -r docker
|
|
|
|
RUN useradd --create-home --gid docker unprivilegeduser
|
|
|
|
|
|
|
|
VOLUME /var/lib/docker
|
|
|
|
WORKDIR /go/src/github.com/docker/docker
|
2016-03-28 14:36:20 -04:00
|
|
|
ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
|
2016-01-15 09:25:03 -05:00
|
|
|
|
|
|
|
# Let us use a .bashrc file
|
|
|
|
RUN ln -sfv $PWD/.bashrc ~/.bashrc
|
|
|
|
|
|
|
|
# Register Docker's bash completion.
|
|
|
|
RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
|
|
|
|
|
|
|
|
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
|
|
|
|
COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
|
|
|
|
RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
|
2016-02-03 07:09:52 -05:00
|
|
|
aarch64/buildpack-deps:jessie@sha256:6aa1d6910791b7ac78265fd0798e5abd6cb3f27ae992f6f960f6c303ec9535f2 \
|
2016-01-15 09:25:03 -05:00
|
|
|
aarch64/busybox:latest@sha256:b23a6a37cf269dff6e46d2473b6e227afa42b037e6d23435f1d2bc40fc8c2828 \
|
|
|
|
aarch64/debian:jessie@sha256:4be74a41a7c70ebe887b634b11ffe516cf4fcd56864a54941e56bb49883c3170 \
|
|
|
|
aarch64/hello-world:latest@sha256:65a4a158587b307bb02db4de41b836addb0c35175bdc801367b1ac1ddeb9afda
|
|
|
|
# see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
|
|
|
|
|
|
|
|
# Download toml validator
|
|
|
|
ENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
|
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
|
|
|
&& git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml" \
|
|
|
|
&& (cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT") \
|
|
|
|
&& go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv \
|
|
|
|
&& rm -rf "$GOPATH"
|
|
|
|
|
2016-03-18 14:50:19 -04:00
|
|
|
# Install runc
|
2016-06-15 17:57:34 -04:00
|
|
|
ENV RUNC_COMMIT cc29e3dded8e27ba8f65738f40d251c885030a28
|
2016-03-18 14:50:19 -04:00
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
2016-06-15 17:57:34 -04:00
|
|
|
&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
2016-03-18 14:50:19 -04:00
|
|
|
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
|
|
|
&& git checkout -q "$RUNC_COMMIT" \
|
2016-03-22 20:55:47 -04:00
|
|
|
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
2016-04-15 00:45:35 -04:00
|
|
|
&& cp runc /usr/local/bin/docker-runc \
|
|
|
|
&& rm -rf "$GOPATH"
|
2016-03-18 14:50:19 -04:00
|
|
|
|
|
|
|
# Install containerd
|
2016-09-12 13:38:55 -04:00
|
|
|
ENV CONTAINERD_COMMIT 4c21ad662f71af56c0e6b29c0afef72df441d1ff
|
2016-03-18 14:50:19 -04:00
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
2016-03-29 03:35:42 -04:00
|
|
|
&& git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \
|
2016-03-18 14:50:19 -04:00
|
|
|
&& cd "$GOPATH/src/github.com/docker/containerd" \
|
|
|
|
&& git checkout -q "$CONTAINERD_COMMIT" \
|
2016-03-22 20:55:47 -04:00
|
|
|
&& make static \
|
|
|
|
&& cp bin/containerd /usr/local/bin/docker-containerd \
|
|
|
|
&& cp bin/containerd-shim /usr/local/bin/docker-containerd-shim \
|
2016-04-15 00:45:35 -04:00
|
|
|
&& cp bin/ctr /usr/local/bin/docker-containerd-ctr \
|
|
|
|
&& rm -rf "$GOPATH"
|
2016-03-18 14:50:19 -04:00
|
|
|
|
2016-06-27 17:38:47 -04:00
|
|
|
ENV GRIMES_COMMIT f207601a8d19a534cc90d9e26e037e9931ccb9db
|
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
|
|
|
&& git clone https://github.com/crosbymichael/grimes.git "$GOPATH/grimes" \
|
|
|
|
&& cd "$GOPATH/grimes" \
|
|
|
|
&& git checkout -q "$GRIMES_COMMIT" \
|
|
|
|
&& make \
|
|
|
|
&& cp init /usr/local/bin/docker-init \
|
|
|
|
&& rm -rf "$GOPATH"
|
|
|
|
|
2016-01-15 09:25:03 -05:00
|
|
|
# Wrap all commands in the "docker-in-docker" script to allow nested containers
|
|
|
|
ENTRYPOINT ["hack/dind"]
|
|
|
|
|
|
|
|
# Upload docker source
|
|
|
|
COPY . /go/src/github.com/docker/docker
|