github.com/kim0/docker@v0.6.2-0.20161130212042-4addda3f07e7/Dockerfile.ppc64le (about)

     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  
    18  # ppc64le/golang is a debian:jessie based image with golang installed
    19  FROM ppc64le/golang:1.6.3
    20  
    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  	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  	--no-install-recommends
    51  
    52  # Get lvm2 source for compiling statically
    53  ENV LVM2_VERSION 2.02.103
    54  RUN mkdir -p /usr/local/lvm2 \
    55  	&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
    56  		| tar -xzC /usr/local/lvm2 --strip-components=1
    57  # See https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
    58  
    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  
    66  # Compile and install lvm2
    67  RUN cd /usr/local/lvm2 \
    68  	&& ./configure \
    69  		--build="$(gcc -print-multiarch)" \
    70  		--enable-static_link \
    71  	&& make device-mapper \
    72  	&& make install_device-mapper
    73  # See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
    74  
    75  # Install seccomp: the version shipped in jessie is too old
    76  ENV SECCOMP_VERSION 2.3.1
    77  RUN set -x \
    78          && export SECCOMP_PATH="$(mktemp -d)" \
    79          && curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
    80                  | tar -xzC "$SECCOMP_PATH" --strip-components=1 \
    81          && ( \
    82                  cd "$SECCOMP_PATH" \
    83                  && ./configure --prefix=/usr/local \
    84                  && make \
    85                  && make install \
    86                  && ldconfig \
    87          ) \
    88          && rm -rf "$SECCOMP_PATH"
    89  
    90  
    91  # Install Go
    92  # ppc64le doesn't have official go binaries, so use the version of go installed from the image
    93  # to build go from source.
    94  # NOTE: ppc64le has compatibility issues with older versions of go, so make sure the version >= 1.6
    95  ENV GO_VERSION 1.7.3
    96  ENV GO_DOWNLOAD_URL https://storage.googleapis.com/golang/go${GO_VERSION}.src.tar.gz
    97  
    98  RUN set -x \
    99  	&& TEMPDIR="$(mktemp -d)" \
   100  	&& mv /usr/local/go $TEMPDIR \
   101  	&& GOROOT_BOOTSTRAP=$TEMPDIR/go \
   102  	&& cd /usr/local \
   103  	&& curl -fsSL "$GO_DOWNLOAD_URL" -o golang.tar.gz \
   104  	&& tar -C /usr/local -xzf golang.tar.gz \
   105  	&& rm golang.tar.gz \
   106  	&& cd go/src && ./make.bash 2>&1 \
   107  	&& rm -rf $TEMPDIR
   108  
   109  ENV GOROOT_BOOTSTRAP /usr/local/go
   110  ENV PATH /usr/local/go/bin/:$PATH
   111  ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
   112  
   113  # Dependency for golint
   114  ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3
   115  RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
   116  	&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT)
   117  
   118  # Grab Go's lint tool
   119  ENV GO_LINT_COMMIT 32a87160691b3c96046c0c678fe57c5bef761456
   120  RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
   121  	&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
   122  	&& go install -v github.com/golang/lint/golint
   123  
   124  # Install two versions of the registry. The first is an older version that
   125  # only supports schema1 manifests. The second is a newer version that supports
   126  # both. This allows integration-cli tests to cover push/pull with both schema1
   127  # and schema2 manifests.
   128  ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
   129  ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
   130  RUN set -x \
   131  	&& export GOPATH="$(mktemp -d)" \
   132  	&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
   133  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
   134  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
   135  		go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
   136  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
   137  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
   138  		go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
   139  	&& rm -rf "$GOPATH"
   140  
   141  # Install notary and notary-server
   142  ENV NOTARY_VERSION v0.4.2
   143  RUN set -x \
   144  	&& export GOPATH="$(mktemp -d)" \
   145  	&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
   146  	&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
   147  	&& GOPATH="$GOPATH/src/github.com/docker/notary/Godeps/_workspace:$GOPATH" \
   148  		go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
   149  	&& GOPATH="$GOPATH/src/github.com/docker/notary/Godeps/_workspace:$GOPATH" \
   150  		go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
   151  	&& rm -rf "$GOPATH"
   152  
   153  # Get the "docker-py" source so we can run their integration tests
   154  ENV DOCKER_PY_COMMIT e2655f658408f9ad1f62abdef3eb6ed43c0cf324
   155  RUN git clone https://github.com/docker/docker-py.git /docker-py \
   156  	&& cd /docker-py \
   157  	&& git checkout -q $DOCKER_PY_COMMIT \
   158  	&& pip install -r test-requirements.txt
   159  
   160  # Set user.email so crosbymichael's in-container merge commits go smoothly
   161  RUN git config --global user.email 'docker-dummy@example.com'
   162  
   163  # Add an unprivileged user to be used for tests which need it
   164  RUN groupadd -r docker
   165  RUN useradd --create-home --gid docker unprivilegeduser
   166  
   167  VOLUME /var/lib/docker
   168  WORKDIR /go/src/github.com/docker/docker
   169  ENV DOCKER_BUILDTAGS apparmor pkcs11 seccomp selinux
   170  
   171  # Let us use a .bashrc file
   172  RUN ln -sfv $PWD/.bashrc ~/.bashrc
   173  
   174  # Register Docker's bash completion.
   175  RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
   176  
   177  # Get useful and necessary Hub images so we can "docker load" locally instead of pulling
   178  COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
   179  RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
   180  	ppc64le/buildpack-deps:jessie@sha256:902bfe4ef1389f94d143d64516dd50a2de75bca2e66d4a44b1d73f63ddf05dda \
   181  	ppc64le/busybox:latest@sha256:38bb82085248d5a3c24bd7a5dc146f2f2c191e189da0441f1c2ca560e3fc6f1b \
   182  	ppc64le/debian:jessie@sha256:412845f51b6ab662afba71bc7a716e20fdb9b84f185d180d4c7504f8a75c4f91 \
   183  	ppc64le/hello-world:latest@sha256:186a40a9a02ca26df0b6c8acdfb8ac2f3ae6678996a838f977e57fac9d963974
   184  # See also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
   185  
   186  # Install tomlv, runc, containerd, grimes, docker-proxy
   187  # Please edit hack/dockerfile/install-binaries.sh to update them.
   188  COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
   189  RUN /tmp/install-binaries.sh tomlv runc containerd grimes proxy
   190  
   191  # Wrap all commands in the "docker-in-docker" script to allow nested containers
   192  ENTRYPOINT ["hack/dind"]
   193  
   194  # Upload docker source
   195  COPY . /go/src/github.com/docker/docker