Dockerfile.ppc64le 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. # This file describes the standard way to build Docker on ppc64le, 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.ppc64le .
  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 ppc64le/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. apt-utils \
  25. aufs-tools \
  26. automake \
  27. bash-completion \
  28. btrfs-tools \
  29. build-essential \
  30. cmake \
  31. createrepo \
  32. curl \
  33. dpkg-sig \
  34. git \
  35. iptables \
  36. jq \
  37. net-tools \
  38. libapparmor-dev \
  39. libcap-dev \
  40. libltdl-dev \
  41. libsystemd-journal-dev \
  42. libtool \
  43. mercurial \
  44. pkg-config \
  45. python-dev \
  46. python-mock \
  47. python-pip \
  48. python-websocket \
  49. xfsprogs \
  50. tar \
  51. vim-common \
  52. --no-install-recommends
  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. # Fix platform enablement in lvm2 to support ppc64le properly
  60. RUN set -e \
  61. && for f in config.guess config.sub; do \
  62. curl -fsSL -o "/usr/local/lvm2/autoconf/$f" "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$f;hb=HEAD"; \
  63. done
  64. # "arch.c:78:2: error: #error the arch code needs to know about your machine type"
  65. # Compile and install lvm2
  66. RUN cd /usr/local/lvm2 \
  67. && ./configure \
  68. --build="$(gcc -print-multiarch)" \
  69. --enable-static_link \
  70. && make device-mapper \
  71. && make install_device-mapper
  72. # See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
  73. # Install seccomp: the version shipped upstream is too old
  74. ENV SECCOMP_VERSION 2.3.2
  75. RUN set -x \
  76. && export SECCOMP_PATH="$(mktemp -d)" \
  77. && curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
  78. | tar -xzC "$SECCOMP_PATH" --strip-components=1 \
  79. && ( \
  80. cd "$SECCOMP_PATH" \
  81. && ./configure --prefix=/usr/local \
  82. && make \
  83. && make install \
  84. && ldconfig \
  85. ) \
  86. && rm -rf "$SECCOMP_PATH"
  87. # Install Go
  88. # NOTE: official ppc64le go binaries weren't available until go 1.6.4 and 1.7.4
  89. ENV GO_VERSION 1.8.3
  90. RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-ppc64le.tar.gz" \
  91. | tar -xzC /usr/local
  92. ENV PATH /go/bin:/usr/local/go/bin:$PATH
  93. ENV GOPATH /go
  94. # Dependency for golint
  95. ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3
  96. RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
  97. && (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT)
  98. # Grab Go's lint tool
  99. ENV GO_LINT_COMMIT 32a87160691b3c96046c0c678fe57c5bef761456
  100. RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
  101. && (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
  102. && go install -v github.com/golang/lint/golint
  103. # Install two versions of the registry. The first is an older version that
  104. # only supports schema1 manifests. The second is a newer version that supports
  105. # both. This allows integration-cli tests to cover push/pull with both schema1
  106. # and schema2 manifests.
  107. ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
  108. ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
  109. RUN set -x \
  110. && export GOPATH="$(mktemp -d)" \
  111. && git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
  112. && (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
  113. && GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
  114. go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
  115. && (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
  116. && GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
  117. go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
  118. && rm -rf "$GOPATH"
  119. # Install notary and notary-server
  120. ENV NOTARY_VERSION v0.5.0
  121. RUN set -x \
  122. && export GOPATH="$(mktemp -d)" \
  123. && git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
  124. && (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
  125. && GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
  126. go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
  127. && GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
  128. go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
  129. && rm -rf "$GOPATH"
  130. # Get the "docker-py" source so we can run their integration tests
  131. ENV DOCKER_PY_COMMIT e2655f658408f9ad1f62abdef3eb6ed43c0cf324
  132. RUN git clone https://github.com/docker/docker-py.git /docker-py \
  133. && cd /docker-py \
  134. && git checkout -q $DOCKER_PY_COMMIT \
  135. && pip install -r test-requirements.txt
  136. # Set user.email so crosbymichael's in-container merge commits go smoothly
  137. RUN git config --global user.email 'docker-dummy@example.com'
  138. # Add an unprivileged user to be used for tests which need it
  139. RUN groupadd -r docker
  140. RUN useradd --create-home --gid docker unprivilegeduser
  141. VOLUME /var/lib/docker
  142. WORKDIR /go/src/github.com/docker/docker
  143. ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
  144. # Let us use a .bashrc file
  145. RUN ln -sfv $PWD/.bashrc ~/.bashrc
  146. # Register Docker's bash completion.
  147. RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
  148. # Get useful and necessary Hub images so we can "docker load" locally instead of pulling
  149. COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
  150. RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
  151. ppc64le/buildpack-deps:jessie@sha256:1a2f2d2cc8738f14b336aeffc3503b5c9dedf9e1f26c7313cb4999534ad4716f \
  152. ppc64le/busybox:latest@sha256:54f34c83adfab20cf0e630d879e210f07b0062cd6caaf16346a61396d50e7584 \
  153. ppc64le/debian:jessie@sha256:ea8c5b105e3790f075145b40e4be1e4488c9f33f55e6cc45182047b80a68f892 \
  154. ppc64le/hello-world:latest@sha256:7d57adf137665f748956c86089320710b66d08584db3500ed98f4bb3da637c2d
  155. # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
  156. # Install tomlv, vndr, runc, containerd, tini, docker-proxy
  157. # Please edit hack/dockerfile/install-binaries.sh to update them.
  158. COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
  159. COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
  160. RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli
  161. ENV PATH=/usr/local/cli:$PATH
  162. # Wrap all commands in the "docker-in-docker" script to allow nested containers
  163. ENTRYPOINT ["hack/dind"]
  164. # Upload docker source
  165. COPY . /go/src/github.com/docker/docker