github.com/ssdev-go/moby@v17.12.1-ce-rc2+incompatible/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 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/debian:stretch
    19  
    20  # Packaged dependencies
    21  RUN apt-get update && apt-get install -y \
    22  	apparmor \
    23  	apt-utils \
    24  	aufs-tools \
    25  	automake \
    26  	bash-completion \
    27  	btrfs-tools \
    28  	build-essential \
    29  	cmake \
    30  	createrepo \
    31  	curl \
    32  	dpkg-sig \
    33  	git \
    34  	iptables \
    35  	jq \
    36  	net-tools \
    37  	libapparmor-dev \
    38  	libcap-dev \
    39  	libdevmapper-dev \
    40  	libseccomp-dev \
    41  	libsystemd-dev \
    42  	libtool \
    43  	libudev-dev \
    44  	mercurial \
    45  	pkg-config \
    46  	python-backports.ssl-match-hostname \
    47  	python-dev \
    48  	python-mock \
    49  	python-pip \
    50  	python-requests \
    51  	python-setuptools \
    52  	python-websocket \
    53  	python-wheel \
    54  	xfsprogs \
    55  	tar \
    56  	thin-provisioning-tools \
    57  	vim-common \
    58  	--no-install-recommends
    59  
    60  # IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored
    61  ENV GO_VERSION 1.9.4
    62  RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-s390x.tar.gz" \
    63  	| tar -xzC /usr/local
    64  
    65  ENV PATH /go/bin:/usr/local/go/bin:$PATH
    66  ENV GOPATH /go
    67  
    68  # Install two versions of the registry. The first is an older version that
    69  # only supports schema1 manifests. The second is a newer version that supports
    70  # both. This allows integration-cli tests to cover push/pull with both schema1
    71  # and schema2 manifests.
    72  ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
    73  ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
    74  RUN set -x \
    75  	&& export GOPATH="$(mktemp -d)" \
    76  	&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
    77  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
    78  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
    79  		go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
    80  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
    81  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
    82  		go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
    83  	&& rm -rf "$GOPATH"
    84  
    85  # Install notary and notary-server
    86  ENV NOTARY_VERSION v0.5.0
    87  RUN set -x \
    88  	&& export GOPATH="$(mktemp -d)" \
    89  	&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
    90  	&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
    91  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
    92  		go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
    93  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
    94  		go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
    95  	&& rm -rf "$GOPATH"
    96  
    97  # Get the "docker-py" source so we can run their integration tests
    98  ENV DOCKER_PY_COMMIT 1d6b5b203222ba5df7dedfcd1ee061a452f99c8a
    99  # To run integration tests docker-pycreds is required.
   100  RUN git clone https://github.com/docker/docker-py.git /docker-py \
   101  	&& cd /docker-py \
   102  	&& git checkout -q $DOCKER_PY_COMMIT \
   103  	&& pip install docker-pycreds==0.2.1 \
   104  	&& pip install -r test-requirements.txt
   105  
   106  # Set user.email so crosbymichael's in-container merge commits go smoothly
   107  RUN git config --global user.email 'docker-dummy@example.com'
   108  
   109  # Add an unprivileged user to be used for tests which need it
   110  RUN groupadd -r docker
   111  RUN useradd --create-home --gid docker unprivilegeduser
   112  
   113  VOLUME /var/lib/docker
   114  WORKDIR /go/src/github.com/docker/docker
   115  ENV DOCKER_BUILDTAGS apparmor selinux seccomp
   116  
   117  # Let us use a .bashrc file
   118  RUN ln -sfv $PWD/.bashrc ~/.bashrc
   119  
   120  # Register Docker's bash completion.
   121  RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
   122  
   123  # Get useful and necessary Hub images so we can "docker load" locally instead of pulling
   124  COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
   125  RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
   126  	s390x/buildpack-deps:jessie@sha256:552dec28146e4d2591fc0309aebdbac9e4fb1f335d90c70a14bbf72fb8bb1be5 \
   127  	s390x/busybox:latest@sha256:e32f40c39ca596a4317392bd32809bb188c4ae5864ea827c3219c75c50069964 \
   128  	s390x/debian:jessie@sha256:6994e3ffa5a1dabea09d536f350b3ed2715292cb469417c42a82b70fcbff7d32 \
   129  	s390x/hello-world:latest@sha256:602db500fee63934292260e65c0c528128ad1c1c7c6497f95bbbac7d4d5312f1
   130  # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
   131  
   132  # Install tomlv, vndr, runc, containerd, tini, docker-proxy
   133  # Please edit hack/dockerfile/install-binaries.sh to update them.
   134  COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
   135  COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
   136  RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter
   137  ENV PATH=/usr/local/cli:$PATH
   138  
   139  # Wrap all commands in the "docker-in-docker" script to allow nested containers
   140  ENTRYPOINT ["hack/dind"]
   141  
   142  # Upload docker source
   143  COPY . /go/src/github.com/docker/docker