Dockerfile.armhf 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. FROM armhf/debian:jessie
  18. # allow replacing httpredir or deb mirror
  19. ARG APT_MIRROR=deb.debian.org
  20. RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
  21. # Packaged dependencies
  22. RUN apt-get update && apt-get install -y \
  23. apparmor \
  24. aufs-tools \
  25. automake \
  26. bash-completion \
  27. btrfs-tools \
  28. build-essential \
  29. createrepo \
  30. curl \
  31. cmake \
  32. dpkg-sig \
  33. git \
  34. iptables \
  35. jq \
  36. net-tools \
  37. libapparmor-dev \
  38. libcap-dev \
  39. libltdl-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. # Get lvm2 source for compiling statically
  54. ENV LVM2_VERSION 2.02.103
  55. RUN mkdir -p /usr/local/lvm2 \
  56. && curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
  57. | tar -xzC /usr/local/lvm2 --strip-components=1
  58. # See https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
  59. # Compile and install lvm2
  60. RUN cd /usr/local/lvm2 \
  61. && ./configure \
  62. --build="$(gcc -print-multiarch)" \
  63. --enable-static_link \
  64. && make device-mapper \
  65. && make install_device-mapper
  66. # See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
  67. # Install Go
  68. ENV GO_VERSION 1.8.3
  69. RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-armv6l.tar.gz" \
  70. | tar -xzC /usr/local
  71. ENV PATH /go/bin:/usr/local/go/bin:$PATH
  72. ENV GOPATH /go
  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. # Dependency for golint
  77. ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3
  78. RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
  79. && (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT)
  80. # Grab Go's lint tool
  81. ENV GO_LINT_COMMIT 32a87160691b3c96046c0c678fe57c5bef761456
  82. RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
  83. && (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
  84. && go install -v github.com/golang/lint/golint
  85. # Install seccomp: the version shipped upstream is too old
  86. ENV SECCOMP_VERSION 2.3.2
  87. RUN set -x \
  88. && export SECCOMP_PATH="$(mktemp -d)" \
  89. && curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
  90. | tar -xzC "$SECCOMP_PATH" --strip-components=1 \
  91. && ( \
  92. cd "$SECCOMP_PATH" \
  93. && ./configure --prefix=/usr/local \
  94. && make \
  95. && make install \
  96. && ldconfig \
  97. ) \
  98. && rm -rf "$SECCOMP_PATH"
  99. # Install two versions of the registry. The first is an older version that
  100. # only supports schema1 manifests. The second is a newer version that supports
  101. # both. This allows integration-cli tests to cover push/pull with both schema1
  102. # and schema2 manifests.
  103. ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
  104. ENV REGISTRY_COMMIT cb08de17d74bef86ce6c5abe8b240e282f5750be
  105. RUN set -x \
  106. && export GOPATH="$(mktemp -d)" \
  107. && git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
  108. && (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
  109. && GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
  110. go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
  111. && (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
  112. && GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
  113. go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
  114. && rm -rf "$GOPATH"
  115. # Install notary and notary-server
  116. ENV NOTARY_VERSION v0.5.0
  117. RUN set -x \
  118. && export GOPATH="$(mktemp -d)" \
  119. && git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
  120. && (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
  121. && GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
  122. go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
  123. && GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
  124. go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
  125. && rm -rf "$GOPATH"
  126. # Get the "docker-py" source so we can run their integration tests
  127. ENV DOCKER_PY_COMMIT e2655f658408f9ad1f62abdef3eb6ed43c0cf324
  128. RUN git clone https://github.com/docker/docker-py.git /docker-py \
  129. && cd /docker-py \
  130. && git checkout -q $DOCKER_PY_COMMIT \
  131. && pip install -r test-requirements.txt
  132. # Set user.email so crosbymichael's in-container merge commits go smoothly
  133. RUN git config --global user.email 'docker-dummy@example.com'
  134. # Add an unprivileged user to be used for tests which need it
  135. RUN groupadd -r docker
  136. RUN useradd --create-home --gid docker unprivilegeduser
  137. VOLUME /var/lib/docker
  138. WORKDIR /go/src/github.com/docker/docker
  139. ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
  140. # Let us use a .bashrc file
  141. RUN ln -sfv $PWD/.bashrc ~/.bashrc
  142. # Register Docker's bash completion.
  143. RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
  144. # Get useful and necessary Hub images so we can "docker load" locally instead of pulling
  145. COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
  146. RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
  147. armhf/buildpack-deps:jessie@sha256:eb2dad77ef53e88d94c3c83862d315c806ea1ca49b6e74f4db362381365ce489 \
  148. armhf/busybox:latest@sha256:016a1e149d2acc2a3789a160dfa60ce870794eea27ad5e96f7a101970e5e1689 \
  149. armhf/debian:jessie@sha256:ac59fa18b28d0ef751eabb5ba4c4b5a9063f99398bae2f70495aa8ed6139b577 \
  150. armhf/hello-world:latest@sha256:9701edc932223a66e49dd6c894a11db8c2cf4eccd1414f1ec105a623bf16b426
  151. # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
  152. # Install tomlv, vndr, runc, containerd, tini, docker-proxy
  153. # Please edit hack/dockerfile/install-binaries.sh to update them.
  154. COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
  155. COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
  156. RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli
  157. ENV PATH=/usr/local/cli:$PATH
  158. ENTRYPOINT ["hack/dind"]
  159. # Upload docker source
  160. COPY . /go/src/github.com/docker/docker