github.com/rhatdan/docker@v0.7.7-0.20180119204836-47a0dcbcd20a/Dockerfile.armhf (about)

     1  # This file describes the standard way to build Docker on ARMv7, using docker
     2  #
     3  # Usage:
     4  #
     5  # # Assemble the full dev environment. This is slow the first time.
     6  # docker build -t docker -f Dockerfile.armhf .
     7  #
     8  # # Mount your source in an interactive container for quick testing:
     9  # docker run -v `pwd`:/go/src/github.com/docker/docker --privileged -i -t docker bash
    10  #
    11  # # Run the test suite:
    12  # docker run --privileged docker hack/make.sh test-unit test-integration test-docker-py
    13  #
    14  # Note: AppArmor used to mess with privileged mode, but this is no longer
    15  # the case. Therefore, you don't have to disable it anymore.
    16  #
    17  
    18  FROM arm32v7/debian:stretch
    19  
    20  # allow replacing httpredir or deb mirror
    21  ARG APT_MIRROR=deb.debian.org
    22  RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
    23  
    24  # Packaged dependencies
    25  RUN apt-get update && apt-get install -y \
    26  	apparmor \
    27  	aufs-tools \
    28  	automake \
    29  	bash-completion \
    30  	btrfs-tools \
    31  	build-essential \
    32  	createrepo \
    33  	curl \
    34  	cmake \
    35  	dpkg-sig \
    36  	git \
    37  	iptables \
    38  	jq \
    39  	net-tools \
    40  	libapparmor-dev \
    41  	libcap-dev \
    42  	libdevmapper-dev \
    43  	libseccomp-dev \
    44  	libsystemd-dev \
    45  	libtool \
    46  	libudev-dev \
    47  	mercurial \
    48  	pigz \
    49  	pkg-config \
    50  	python-backports.ssl-match-hostname \
    51  	python-dev \
    52  	python-mock \
    53  	python-pip \
    54  	python-requests \
    55  	python-setuptools \
    56  	python-websocket \
    57  	python-wheel \
    58  	xfsprogs \
    59  	tar \
    60  	thin-provisioning-tools \
    61  	vim-common \
    62  	--no-install-recommends \
    63  	&& pip install awscli==1.10.15
    64  
    65  # Install Go
    66  # IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored
    67  ENV GO_VERSION 1.9.2
    68  RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" \
    69  	| tar -xzC /usr/local
    70  ENV PATH /go/bin:/usr/local/go/bin:$PATH
    71  ENV GOPATH /go
    72  
    73  # We're building for armhf, which is ARMv7, so let's be explicit about that
    74  ENV GOARCH arm
    75  ENV GOARM 7
    76  
    77  # Install two versions of the registry. The first is an older version that
    78  # only supports schema1 manifests. The second is a newer version that supports
    79  # both. This allows integration-cli tests to cover push/pull with both schema1
    80  # and schema2 manifests.
    81  ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
    82  ENV REGISTRY_COMMIT cb08de17d74bef86ce6c5abe8b240e282f5750be
    83  RUN set -x \
    84  	&& export GOPATH="$(mktemp -d)" \
    85  	&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
    86  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
    87  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
    88  		go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
    89  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
    90  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
    91  		go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
    92  	&& rm -rf "$GOPATH"
    93  
    94  # Install notary and notary-server
    95  ENV NOTARY_VERSION v0.5.0
    96  RUN set -x \
    97  	&& export GOPATH="$(mktemp -d)" \
    98  	&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
    99  	&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
   100  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
   101  		go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
   102  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
   103  		go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
   104  	&& rm -rf "$GOPATH"
   105  
   106  # Get the "docker-py" source so we can run their integration tests
   107  ENV DOCKER_PY_COMMIT 1d6b5b203222ba5df7dedfcd1ee061a452f99c8a
   108  # To run integration tests docker-pycreds is required.
   109  RUN git clone https://github.com/docker/docker-py.git /docker-py \
   110  	&& cd /docker-py \
   111  	&& git checkout -q $DOCKER_PY_COMMIT \
   112  	&& pip install docker-pycreds==0.2.1 \
   113  	&& pip install -r test-requirements.txt
   114  
   115  # Set user.email so crosbymichael's in-container merge commits go smoothly
   116  RUN git config --global user.email 'docker-dummy@example.com'
   117  
   118  # Add an unprivileged user to be used for tests which need it
   119  RUN groupadd -r docker
   120  RUN useradd --create-home --gid docker unprivilegeduser
   121  
   122  VOLUME /var/lib/docker
   123  WORKDIR /go/src/github.com/docker/docker
   124  ENV DOCKER_BUILDTAGS apparmor seccomp selinux
   125  
   126  # Let us use a .bashrc file
   127  RUN ln -sfv $PWD/.bashrc ~/.bashrc
   128  
   129  # Register Docker's bash completion.
   130  RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
   131  
   132  # Get useful and necessary Hub images so we can "docker load" locally instead of pulling
   133  COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
   134  RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
   135  	buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
   136  	busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
   137  	debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
   138  	hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
   139  # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
   140  
   141  # Install tomlv, vndr, runc, containerd, tini, docker-proxy
   142  # Please edit hack/dockerfile/install-binaries.sh to update them.
   143  COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
   144  COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
   145  RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter
   146  ENV PATH=/usr/local/cli:$PATH
   147  
   148  ENTRYPOINT ["hack/dind"]
   149  
   150  # Options for hack/validate/gometalinter
   151  ENV GOMETALINTER_OPTS="--deadline=10m -j2"
   152  
   153  # Upload docker source
   154  COPY . /go/src/github.com/docker/docker