github.com/fabiokung/docker@v0.11.2-0.20170222101415-4534dcd49497/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/debian:jessie
    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  	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  
    53  # Install seccomp: the version shipped in jessie is too old
    54  ENV SECCOMP_VERSION 2.3.1
    55  RUN set -x \
    56  	&& export SECCOMP_PATH="$(mktemp -d)" \
    57  	&& curl -fsSL "https://github.com/seccomp/libseccomp/releases/download/v${SECCOMP_VERSION}/libseccomp-${SECCOMP_VERSION}.tar.gz" \
    58  		| tar -xzC "$SECCOMP_PATH" --strip-components=1 \
    59  	&& ( \
    60  		cd "$SECCOMP_PATH" \
    61  		&& ./configure --prefix=/usr/local \
    62  		&& make \
    63  		&& make install \
    64  		&& ldconfig \
    65  	) \
    66  	&& rm -rf "$SECCOMP_PATH"
    67  
    68  # Get lvm2 source for compiling statically
    69  ENV LVM2_VERSION 2.02.103
    70  RUN mkdir -p /usr/local/lvm2 \
    71  	&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
    72  		| tar -xzC /usr/local/lvm2 --strip-components=1
    73  # See https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
    74  
    75  # Fix platform enablement in lvm2 to support s390x properly
    76  RUN set -e \
    77  	&& for f in config.guess config.sub; do \
    78  		curl -fsSL -o "/usr/local/lvm2/autoconf/$f" "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$f;hb=HEAD"; \
    79  	done
    80  # "arch.c:78:2: error: #error the arch code needs to know about your machine type"
    81  
    82  # Compile and install lvm2
    83  RUN cd /usr/local/lvm2 \
    84  	&& ./configure \
    85  		--build="$(gcc -print-multiarch)" \
    86  		--enable-static_link \
    87  	&& make device-mapper \
    88  	&& make install_device-mapper
    89  # See https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
    90  
    91  ENV GO_VERSION 1.7.5
    92  RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-s390x.tar.gz" \
    93  	| tar -xzC /usr/local
    94  
    95  ENV PATH /go/bin:/usr/local/go/bin:$PATH
    96  ENV GOPATH /go
    97  
    98  # Dependency for golint
    99  ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3
   100  RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \
   101  	&& (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT)
   102  
   103  # Grab Go's lint tool
   104  ENV GO_LINT_COMMIT 32a87160691b3c96046c0c678fe57c5bef761456
   105  RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \
   106  	&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
   107  	&& go install -v github.com/golang/lint/golint
   108  
   109  # Install two versions of the registry. The first is an older version that
   110  # only supports schema1 manifests. The second is a newer version that supports
   111  # both. This allows integration-cli tests to cover push/pull with both schema1
   112  # and schema2 manifests.
   113  ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
   114  ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
   115  RUN set -x \
   116  	&& export GOPATH="$(mktemp -d)" \
   117  	&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
   118  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
   119  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
   120  		go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
   121  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
   122  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
   123  		go build -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
   124  	&& rm -rf "$GOPATH"
   125  
   126  # Install notary and notary-server
   127  ENV NOTARY_VERSION v0.5.0
   128  RUN set -x \
   129  	&& export GOPATH="$(mktemp -d)" \
   130  	&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
   131  	&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
   132  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
   133  		go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
   134  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
   135  		go build -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
   136  	&& rm -rf "$GOPATH"
   137  
   138  # Get the "docker-py" source so we can run their integration tests
   139  ENV DOCKER_PY_COMMIT e2655f658408f9ad1f62abdef3eb6ed43c0cf324
   140  RUN git clone https://github.com/docker/docker-py.git /docker-py \
   141  	&& cd /docker-py \
   142  	&& git checkout -q $DOCKER_PY_COMMIT \
   143  	&& pip install -r test-requirements.txt
   144  
   145  # Set user.email so crosbymichael's in-container merge commits go smoothly
   146  RUN git config --global user.email 'docker-dummy@example.com'
   147  
   148  # Add an unprivileged user to be used for tests which need it
   149  RUN groupadd -r docker
   150  RUN useradd --create-home --gid docker unprivilegeduser
   151  
   152  VOLUME /var/lib/docker
   153  WORKDIR /go/src/github.com/docker/docker
   154  ENV DOCKER_BUILDTAGS apparmor selinux seccomp
   155  
   156  # Let us use a .bashrc file
   157  RUN ln -sfv $PWD/.bashrc ~/.bashrc
   158  
   159  # Register Docker's bash completion.
   160  RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
   161  
   162  # Get useful and necessary Hub images so we can "docker load" locally instead of pulling
   163  COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
   164  RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
   165  	s390x/buildpack-deps:jessie@sha256:4d1381224acaca6c4bfe3604de3af6972083a8558a99672cb6989c7541780099 \
   166  	s390x/busybox:latest@sha256:dd61522c983884a66ed72d60301925889028c6d2d5e0220a8fe1d9b4c6a4f01b \
   167  	s390x/debian:jessie@sha256:b74c863400909eff3c5e196cac9bfd1f6333ce47aae6a38398d87d5875da170a \
   168  	s390x/hello-world:latest@sha256:780d80b3a7677c3788c0d5cd9168281320c8d4a6d9183892d8ee5cdd610f5699
   169  # See also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
   170  
   171  # Install tomlv, vndr, runc, containerd, tini, docker-proxy
   172  # Please edit hack/dockerfile/install-binaries.sh to update them.
   173  COPY hack/dockerfile/binaries-commits /tmp/binaries-commits
   174  COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh
   175  RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy
   176  
   177  # Wrap all commands in the "docker-in-docker" script to allow nested containers
   178  ENTRYPOINT ["hack/dind"]
   179  
   180  # Upload docker source
   181  COPY . /go/src/github.com/docker/docker