github.com/nullne/docker@v1.13.0-rc1/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-cli 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 armhf/debian:jessie
    19  
    20  # Packaged dependencies
    21  RUN apt-get update && apt-get install -y \
    22  	apparmor \
    23  	aufs-tools \
    24  	automake \
    25  	bash-completion \
    26  	btrfs-tools \
    27  	build-essential \
    28  	createrepo \
    29  	curl \
    30  	cmake \
    31  	dpkg-sig \
    32  	git \
    33  	iptables \
    34  	jq \
    35  	net-tools \
    36  	libapparmor-dev \
    37  	libcap-dev \
    38  	libltdl-dev \
    39  	libsqlite3-dev \
    40  	libsystemd-journal-dev \
    41  	libtool \
    42  	mercurial \
    43  	pkg-config \
    44  	python-dev \
    45  	python-mock \
    46  	python-pip \
    47  	python-websocket \
    48  	xfsprogs \
    49  	tar \
    50  	vim-common \
    51  	--no-install-recommends \
    52  	&& pip install awscli==1.10.15
    53  
    54  # Get lvm2 source for compiling statically
    55  ENV LVM2_VERSION 2.02.103
    56  RUN mkdir -p /usr/local/lvm2 \
    57  	&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
    58  		| tar -xzC /usr/local/lvm2 --strip-components=1
    59  # See https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
    60  
    61  # Compile and install lvm2
    62  RUN cd /usr/local/lvm2 \
    63  	&& ./configure \
    64  		--build="$(gcc -print-multiarch)" \
    65  		--enable-static_link \
    66  	&& make device-mapper \
    67  	&& make install_device-mapper
    68  # See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
    69  
    70  # Install Go
    71  ENV GO_VERSION 1.7.3
    72  RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" \
    73  	| tar -xzC /usr/local
    74  ENV PATH /go/bin:/usr/local/go/bin:$PATH
    75  ENV GOPATH /go
    76  
    77  # We're building for armhf, which is ARMv7, so let's be explicit about that
    78  ENV GOARCH arm
    79  ENV GOARM 7
    80  
    81  # Dependency for golint
    82  ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3
    83  RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
    84  	&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT)
    85  
    86  # Grab Go's lint tool
    87  ENV GO_LINT_COMMIT 32a87160691b3c96046c0c678fe57c5bef761456
    88  RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
    89  	&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
    90  	&& go install -v github.com/golang/lint/golint
    91  
    92  # Install seccomp: the version shipped in trusty is too old
    93  ENV SECCOMP_VERSION 2.3.1
    94  RUN set -x \
    95  	&& export SECCOMP_PATH="$(mktemp -d)" \
    96  	&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
    97  		| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
    98  	&& ( \
    99  		cd "$SECCOMP_PATH" \
   100  		&& ./configure --prefix=/usr/local \
   101  		&& make \
   102  		&& make install \
   103  		&& ldconfig \
   104  	) \
   105  	&& rm -rf "$SECCOMP_PATH"
   106  
   107  # Install two versions of the registry. The first is an older version that
   108  # only supports schema1 manifests. The second is a newer version that supports
   109  # both. This allows integration-cli tests to cover push/pull with both schema1
   110  # and schema2 manifests.
   111  ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
   112  ENV REGISTRY_COMMIT cb08de17d74bef86ce6c5abe8b240e282f5750be
   113  RUN set -x \
   114  	&& export GOPATH="$(mktemp -d)" \
   115  	&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
   116  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
   117  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
   118  		go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
   119  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
   120  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
   121  		go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
   122  	&& rm -rf "$GOPATH"
   123  
   124  # Install notary and notary-server
   125  ENV NOTARY_VERSION v0.4.2
   126  RUN set -x \
   127  	&& export GOPATH="$(mktemp -d)" \
   128  	&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
   129  	&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
   130  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
   131  		go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
   132  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
   133  		go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
   134  	&& rm -rf "$GOPATH"
   135  
   136  # Get the "docker-py" source so we can run their integration tests
   137  ENV DOCKER_PY_COMMIT e2655f658408f9ad1f62abdef3eb6ed43c0cf324
   138  RUN git clone https://github.com/docker/docker-py.git /docker-py \
   139  	&& cd /docker-py \
   140  	&& git checkout -q $DOCKER_PY_COMMIT \
   141  	&& pip install -r test-requirements.txt
   142  
   143  # Set user.email so crosbymichael's in-container merge commits go smoothly
   144  RUN git config --global user.email 'docker-dummy@example.com'
   145  
   146  # Add an unprivileged user to be used for tests which need it
   147  RUN groupadd -r docker
   148  RUN useradd --create-home --gid docker unprivilegeduser
   149  
   150  VOLUME /var/lib/docker
   151  WORKDIR /go/src/github.com/docker/docker
   152  ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
   153  
   154  # Let us use a .bashrc file
   155  RUN ln -sfv $PWD/.bashrc ~/.bashrc
   156  
   157  # Register Docker's bash completion.
   158  RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
   159  
   160  # Get useful and necessary Hub images so we can "docker load" locally instead of pulling
   161  COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
   162  RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
   163  	armhf/buildpack-deps:jessie@sha256:ca6cce8e5bf5c952129889b5cc15cd6aa8d995d77e55e3749bbaadae50e476cb \
   164  	armhf/busybox:latest@sha256:d98a7343ac750ffe387e3d514f8521ba69846c216778919b01414b8617cfb3d4 \
   165  	armhf/debian:jessie@sha256:4a2187483f04a84f9830910fe3581d69b3c985cc045d9f01d8e2f3795b28107b \
   166  	armhf/hello-world:latest@sha256:161dcecea0225975b2ad5f768058212c1e0d39e8211098666ffa1ac74cfb7791
   167  # See also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
   168  
   169  # Install tomlv, vndr, runc, containerd, tini, docker-proxy
   170  # Please edit hack/dockerfile/install-binaries.sh to update them.
   171  COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
   172  COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
   173  RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy
   174  
   175  ENTRYPOINT ["hack/dind"]
   176  
   177  # Upload docker source
   178  COPY . /go/src/github.com/docker/docker