66d24c2b |
# 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: |
bc82b139 |
# docker run --privileged docker hack/make.sh test-unit test-integration test-docker-py |
66d24c2b |
#
# Note: AppArmor used to mess with privileged mode, but this is no longer
# the case. Therefore, you don't have to disable it anymore.
#
|
7fc697eb |
FROM debian:stretch |
e89a5e5e |
# allow replacing httpredir or deb mirror
ARG APT_MIRROR=deb.debian.org
RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list |
66d24c2b |
# Packaged dependencies
RUN apt-get update && apt-get install -y \
apparmor \ |
e89a5e5e |
apt-utils \ |
66d24c2b |
aufs-tools \
automake \
bash-completion \ |
e89a5e5e |
bsdmainutils \ |
66d24c2b |
btrfs-tools \
build-essential \ |
d58b4762 |
cmake \ |
66d24c2b |
createrepo \
curl \
dpkg-sig \
gcc \
git \
iptables \
jq \ |
e89a5e5e |
less \ |
66d24c2b |
libapparmor-dev \
libcap-dev \ |
84f1c054 |
libdevmapper-dev \ |
e89a5e5e |
libnl-3-dev \
libprotobuf-c0-dev \
libprotobuf-dev \ |
1b51a053 |
libseccomp-dev \ |
7d80d64c |
libsystemd-dev \ |
e89a5e5e |
libtool \
libudev-dev \ |
66d24c2b |
mercurial \ |
f27b5dda |
net-tools \ |
fd35494a |
pigz \ |
66d24c2b |
pkg-config \ |
e89a5e5e |
protobuf-compiler \
protobuf-c-compiler \ |
ce2a0120 |
python-backports.ssl-match-hostname \ |
66d24c2b |
python-dev \
python-mock \
python-pip \ |
ce2a0120 |
python-requests \ |
47d887b3 |
python-setuptools \ |
66d24c2b |
python-websocket \ |
ce2a0120 |
python-wheel \ |
e89a5e5e |
tar \
thin-provisioning-tools \
vim \ |
d58b4762 |
vim-common \ |
e89a5e5e |
xfsprogs \
zip \ |
66d24c2b |
--no-install-recommends
# Install Go |
4a3cfda4 |
# IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored |
d6e1cc32 |
ENV GO_VERSION 1.9.2 |
503fe408 |
RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-arm64.tar.gz" \
| tar -xzC /usr/local |
7d80d64c |
|
503fe408 |
ENV PATH /go/bin:/usr/local/go/bin:$PATH |
f2614f21 |
ENV GOPATH /go |
66d24c2b |
|
d8d47f42 |
# 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 |
66d24c2b |
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"
|
6e4c87c0 |
# Install notary and notary-server |
175792a6 |
ENV NOTARY_VERSION v0.5.0 |
66d24c2b |
RUN set -x \
&& export GOPATH="$(mktemp -d)" \
&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \ |
589c8a87 |
&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \ |
3e0bd74a |
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \ |
66d24c2b |
go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \ |
3e0bd74a |
&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \ |
d8d47f42 |
go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \ |
66d24c2b |
&& rm -rf "$GOPATH"
# Get the "docker-py" source so we can run their integration tests |
d1a0773d |
ENV DOCKER_PY_COMMIT 1d6b5b203222ba5df7dedfcd1ee061a452f99c8a |
7439d360 |
# To run integration tests docker-pycreds is required. |
66d24c2b |
RUN git clone https://github.com/docker/docker-py.git /docker-py \
&& cd /docker-py \
&& git checkout -q $DOCKER_PY_COMMIT \ |
0ec8f56a |
&& pip install docker-pycreds==0.2.1 \ |
66d24c2b |
&& pip install -r test-requirements.txt
|
cdf17e69 |
# Install yamllint for validating swagger.yaml
RUN pip install yamllint==1.5.0
# Install go-swagger for validating swagger.yaml
ENV GO_SWAGGER_COMMIT c28258affb0b6251755d92489ef685af8d4ff3eb
RUN git clone https://github.com/go-swagger/go-swagger.git /go/src/github.com/go-swagger/go-swagger \
&& (cd /go/src/github.com/go-swagger/go-swagger && git checkout -q $GO_SWAGGER_COMMIT) \
&& go install -v github.com/go-swagger/go-swagger/cmd/swagger
|
66d24c2b |
# 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 |
b877fc31 |
ENV DOCKER_BUILDTAGS apparmor seccomp selinux |
66d24c2b |
# 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 \ |
7fc697eb |
buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c |
1ecd8ed5 |
# See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list) |
66d24c2b |
|
d58b4762 |
# Install tomlv, vndr, runc, containerd, tini, docker-proxy |
1b41125a |
# Please edit hack/dockerfile/install-binaries.sh to update them. |
2790ac68 |
COPY hack/dockerfile/binaries-commits /tmp/binaries-commits |
1b41125a |
COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh |
fc3040a4 |
RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter |
32915b1d |
ENV PATH=/usr/local/cli:$PATH |
ee3ac3aa |
|
66d24c2b |
# Wrap all commands in the "docker-in-docker" script to allow nested containers
ENTRYPOINT ["hack/dind"]
|
b96093fa |
# Options for hack/validate/gometalinter |
c11508a5 |
ENV GOMETALINTER_OPTS="--deadline=4m -j2" |
503b03a3 |
# Upload docker source
COPY . /go/src/github.com/docker/docker |