github.com/vieux/docker@v0.6.3-0.20161004191708-e097c2a938c7/Dockerfile.s390x (about)

     1  # This file describes the standard way to build Docker on s390x, 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.s390x .
     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 s390x/gcc:6.1
    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  	dpkg-sig \
    31  	git \
    32  	iptables \
    33  	jq \
    34  	net-tools \
    35  	libapparmor-dev \
    36  	libcap-dev \
    37  	libltdl-dev \
    38  	libsqlite3-dev \
    39  	libsystemd-journal-dev \
    40  	libtool \
    41  	mercurial \
    42  	pkg-config \
    43  	python-dev \
    44  	python-mock \
    45  	python-pip \
    46  	python-websocket \
    47  	xfsprogs \
    48  	tar \
    49  	--no-install-recommends
    50  
    51  # glibc in Debian has a bug specific to s390x that won't be fixed until Debian 8.6 is released
    52  # - https://github.com/docker/docker/issues/24748
    53  # - https://sourceware.org/git/?p=glibc.git;a=commit;h=890b7a4b33d482b5c768ab47d70758b80227e9bc
    54  # - https://sourceware.org/git/?p=glibc.git;a=commit;h=2e807f29595eb5b1e5d0decc6e356a3562ecc58e
    55  RUN echo 'deb http://httpredir.debian.org/debian jessie-proposed-updates main' >> /etc/apt/sources.list.d/pu.list \
    56  	&& apt-get update \
    57  	&& apt-get install -y libc6 \
    58  	&& rm -rf /var/lib/apt/lists/*
    59  
    60  # Install seccomp: the version shipped in jessie is too old
    61  ENV SECCOMP_VERSION 2.3.1
    62  RUN set -x \
    63  	&& export SECCOMP_PATH="$(mktemp -d)" \
    64  	&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
    65  		| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
    66  	&& ( \
    67  		cd "$SECCOMP_PATH" \
    68  		&& ./configure --prefix=/usr/local \
    69  		&& make \
    70  		&& make install \
    71  		&& ldconfig \
    72  	) \
    73  	&& rm -rf "$SECCOMP_PATH"
    74  
    75  # Get lvm2 source for compiling statically
    76  ENV LVM2_VERSION 2.02.103
    77  RUN mkdir -p /usr/local/lvm2 \
    78  	&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
    79  		| tar -xzC /usr/local/lvm2 --strip-components=1
    80  # See https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
    81  
    82  # Fix platform enablement in lvm2 to support s390x properly
    83  RUN set -e \
    84  	&& for f in config.guess config.sub; do \
    85  		curl -fsSL -o "/usr/local/lvm2/autoconf/$f" "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$f;hb=HEAD"; \
    86  	done
    87  # "arch.c:78:2: error: #error the arch code needs to know about your machine type"
    88  
    89  # Compile and install lvm2
    90  RUN cd /usr/local/lvm2 \
    91  	&& ./configure \
    92  		--build="$(gcc -print-multiarch)" \
    93  		--enable-static_link \
    94  	&& make device-mapper \
    95  	&& make install_device-mapper
    96  # See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
    97  
    98  ENV GO_VERSION 1.7.1
    99  RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-s390x.tar.gz" \
   100  	| tar -xzC /usr/local
   101  
   102  ENV PATH /go/bin:/usr/local/go/bin:$PATH
   103  ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
   104  
   105  # Dependency for golint
   106  ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3
   107  RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
   108  	&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT)
   109  
   110  # Grab Go's lint tool
   111  ENV GO_LINT_COMMIT 32a87160691b3c96046c0c678fe57c5bef761456
   112  RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
   113  	&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
   114  	&& go install -v github.com/golang/lint/golint
   115  
   116  # Install two versions of the registry. The first is an older version that
   117  # only supports schema1 manifests. The second is a newer version that supports
   118  # both. This allows integration-cli tests to cover push/pull with both schema1
   119  # and schema2 manifests.
   120  ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
   121  ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
   122  RUN set -x \
   123  	&& export GOPATH="$(mktemp -d)" \
   124  	&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
   125  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
   126  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
   127  		go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
   128  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
   129  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
   130  		go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
   131  	&& rm -rf "$GOPATH"
   132  
   133  # Install notary and notary-server
   134  ENV NOTARY_VERSION v0.3.0
   135  RUN set -x \
   136  	&& export GOPATH="$(mktemp -d)" \
   137  	&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
   138  	&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
   139  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
   140  		go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
   141  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
   142  		go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
   143  	&& rm -rf "$GOPATH"
   144  
   145  # Get the "docker-py" source so we can run their integration tests
   146  ENV DOCKER_PY_COMMIT e2655f658408f9ad1f62abdef3eb6ed43c0cf324
   147  RUN git clone https://github.com/docker/docker-py.git /docker-py \
   148  	&& cd /docker-py \
   149  	&& git checkout -q $DOCKER_PY_COMMIT \
   150  	&& pip install -r test-requirements.txt
   151  
   152  # Set user.email so crosbymichael's in-container merge commits go smoothly
   153  RUN git config --global user.email 'docker-dummy@example.com'
   154  
   155  # Add an unprivileged user to be used for tests which need it
   156  RUN groupadd -r docker
   157  RUN useradd --create-home --gid docker unprivilegeduser
   158  
   159  VOLUME /var/lib/docker
   160  WORKDIR /go/src/github.com/docker/docker
   161  ENV DOCKER_BUILDTAGS apparmor selinux seccomp
   162  
   163  # Let us use a .bashrc file
   164  RUN ln -sfv $PWD/.bashrc ~/.bashrc
   165  
   166  # Register Docker's bash completion.
   167  RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
   168  
   169  # Get useful and necessary Hub images so we can "docker load" locally instead of pulling
   170  COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
   171  RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
   172  	s390x/buildpack-deps:jessie@sha256:4d1381224acaca6c4bfe3604de3af6972083a8558a99672cb6989c7541780099 \
   173  	s390x/busybox:latest@sha256:dd61522c983884a66ed72d60301925889028c6d2d5e0220a8fe1d9b4c6a4f01b \
   174  	s390x/debian:jessie@sha256:b74c863400909eff3c5e196cac9bfd1f6333ce47aae6a38398d87d5875da170a \
   175  	s390x/hello-world:latest@sha256:780d80b3a7677c3788c0d5cd9168281320c8d4a6d9183892d8ee5cdd610f5699
   176  # See also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
   177  
   178  # Download toml validator
   179  ENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
   180  RUN set -x \
   181  	&& export GOPATH="$(mktemp -d)" \
   182  	&& git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml" \
   183  	&& (cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT") \
   184  	&& go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv \
   185  	&& rm -rf "$GOPATH"
   186  
   187  # Install runc
   188  ENV RUNC_COMMIT cc29e3dded8e27ba8f65738f40d251c885030a28
   189  RUN set -x \
   190  	&& export GOPATH="$(mktemp -d)" \
   191  	&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
   192  	&& cd "$GOPATH/src/github.com/opencontainers/runc" \
   193  	&& git checkout -q "$RUNC_COMMIT" \
   194  	&& make static BUILDTAGS="seccomp apparmor selinux" \
   195  	&& cp runc /usr/local/bin/docker-runc \
   196  	&& rm -rf "$GOPATH"
   197  
   198  # Install containerd
   199  ENV CONTAINERD_COMMIT 2545227b0357eb55e369fa0072baef9ad91cdb69
   200  RUN set -x \
   201  	&& export GOPATH="$(mktemp -d)" \
   202  	&& git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \
   203  	&& cd "$GOPATH/src/github.com/docker/containerd" \
   204  	&& git checkout -q "$CONTAINERD_COMMIT" \
   205  	&& make static \
   206  	&& cp bin/containerd /usr/local/bin/docker-containerd \
   207  	&& cp bin/containerd-shim /usr/local/bin/docker-containerd-shim \
   208  	&& cp bin/ctr /usr/local/bin/docker-containerd-ctr \
   209  	&& rm -rf "$GOPATH"
   210  
   211  ENV GRIMES_COMMIT f207601a8d19a534cc90d9e26e037e9931ccb9db
   212  RUN set -x \
   213      && export GOPATH="$(mktemp -d)" \
   214  	&& git clone https://github.com/crosbymichael/grimes.git "$GOPATH/grimes" \
   215  	&& cd "$GOPATH/grimes" \
   216  	&& git checkout -q "$GRIMES_COMMIT" \
   217  	&& make \
   218  	&& cp init /usr/local/bin/docker-init \
   219  	&& rm -rf "$GOPATH"
   220  
   221  # Wrap all commands in the "docker-in-docker" script to allow nested containers
   222  ENTRYPOINT ["hack/dind"]
   223  
   224  # Upload docker source
   225  COPY . /go/src/github.com/docker/docker