github.com/rita33cool1/iot-system-gateway@v0.0.0-20200911033302-e65bde238cc5/docker-engine/Dockerfile (about)

     1  # This file describes the standard way to build Docker, using docker
     2  #
     3  # Usage:
     4  #
     5  # # Use make to build a development environment image and run it in a container.
     6  # # This is slow the first time.
     7  # make BIND_DIR=. shell
     8  #
     9  # The following commands are executed inside the running container.
    10  
    11  # # Make a dockerd binary.
    12  # # hack/make.sh binary
    13  #
    14  # # Install dockerd to /usr/local/bin
    15  # # make install
    16  #
    17  # # Run unit tests
    18  # # hack/test/unit
    19  #
    20  # # Run tests e.g. integration, py
    21  # # hack/make.sh binary test-integration test-docker-py
    22  #
    23  # # Publish a release:
    24  # docker run --privileged \
    25  #  -e AWS_S3_BUCKET=baz \
    26  #  -e AWS_ACCESS_KEY=foo \
    27  #  -e AWS_SECRET_KEY=bar \
    28  #  -e GPG_PASSPHRASE=gloubiboulga \
    29  #  docker hack/release.sh
    30  #
    31  # Note: AppArmor used to mess with privileged mode, but this is no longer
    32  # the case. Therefore, you don't have to disable it anymore.
    33  #
    34  
    35  FROM debian:stretch
    36  
    37  # allow replacing httpredir or deb mirror
    38  ARG APT_MIRROR=deb.debian.org
    39  RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
    40  
    41  # Packaged dependencies
    42  RUN apt-get update && apt-get install -y \
    43  	apparmor \
    44  	apt-utils \
    45  	aufs-tools \
    46  	automake \
    47  	bash-completion \
    48  	binutils-mingw-w64 \
    49  	bsdmainutils \
    50  	btrfs-tools \
    51  	build-essential \
    52  	cmake \
    53  	createrepo \
    54  	curl \
    55  	dpkg-sig \
    56  	gcc-mingw-w64 \
    57  	git \
    58  	iptables \
    59  	jq \
    60  	less \
    61  	libapparmor-dev \
    62  	libcap-dev \
    63  	libdevmapper-dev \
    64  	libnet-dev \
    65  	libnl-3-dev \
    66  	libprotobuf-c0-dev \
    67  	libprotobuf-dev \
    68  	libseccomp-dev \
    69  	libsystemd-dev \
    70  	libtool \
    71  	libudev-dev \
    72  	mercurial \
    73  	net-tools \
    74  	pigz \
    75  	pkg-config \
    76  	protobuf-compiler \
    77  	protobuf-c-compiler \
    78  	python-backports.ssl-match-hostname \
    79  	python-dev \
    80  	python-mock \
    81  	python-pip \
    82  	python-requests \
    83  	python-setuptools \
    84  	python-websocket \
    85  	python-wheel \
    86  	tar \
    87  	thin-provisioning-tools \
    88  	vim \
    89  	vim-common \
    90  	xfsprogs \
    91  	zip \
    92  	--no-install-recommends \
    93  	&& pip install awscli==1.10.15
    94  
    95  # Install Go
    96  # IMPORTANT: If the version of Go is updated, the Windows to Linux CI machines
    97  #            will need updating, to avoid errors. Ping #docker-maintainers on IRC
    98  #            with a heads-up.
    99  # IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored
   100  ENV GO_VERSION 1.9.5
   101  RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz" \
   102  	| tar -xzC /usr/local
   103  
   104  ENV PATH /go/bin:/usr/local/go/bin:$PATH
   105  ENV GOPATH /go
   106  
   107  # Install CRIU for checkpoint/restore support
   108  ENV CRIU_VERSION 3.6
   109  RUN mkdir -p /usr/src/criu \
   110  	&& curl -sSL https://github.com/checkpoint-restore/criu/archive/v${CRIU_VERSION}.tar.gz | tar -C /usr/src/criu/ -xz --strip-components=1 \
   111  	&& cd /usr/src/criu \
   112  	&& make \
   113  	&& make install-criu
   114  
   115  # Install two versions of the registry. The first is an older version that
   116  # only supports schema1 manifests. The second is a newer version that supports
   117  # both. This allows integration-cli tests to cover push/pull with both schema1
   118  # and schema2 manifests.
   119  ENV REGISTRY_COMMIT_SCHEMA1 ec87e9b6971d831f0eff752ddb54fb64693e51cd
   120  ENV REGISTRY_COMMIT 47a064d4195a9b56133891bbb13620c3ac83a827
   121  RUN set -x \
   122  	&& export GOPATH="$(mktemp -d)" \
   123  	&& git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \
   124  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \
   125  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
   126  		go build -buildmode=pie -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \
   127  	&& (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT_SCHEMA1") \
   128  	&& GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \
   129  		go build -buildmode=pie -o /usr/local/bin/registry-v2-schema1 github.com/docker/distribution/cmd/registry \
   130  	&& rm -rf "$GOPATH"
   131  
   132  # Install notary and notary-server
   133  ENV NOTARY_VERSION v0.5.0
   134  RUN set -x \
   135  	&& export GOPATH="$(mktemp -d)" \
   136  	&& git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \
   137  	&& (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_VERSION") \
   138  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
   139  		go build -buildmode=pie -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \
   140  	&& GOPATH="$GOPATH/src/github.com/docker/notary/vendor:$GOPATH" \
   141  		go build -buildmode=pie -o /usr/local/bin/notary github.com/docker/notary/cmd/notary \
   142  	&& rm -rf "$GOPATH"
   143  
   144  # Get the "docker-py" source so we can run their integration tests
   145  ENV DOCKER_PY_COMMIT 8b246db271a85d6541dc458838627e89c683e42f
   146  # To run integration tests docker-pycreds is required.
   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 docker-pycreds==0.2.1 \
   151  	&& pip install -r test-requirements.txt
   152  
   153  # Install yamllint for validating swagger.yaml
   154  RUN pip install yamllint==1.5.0
   155  
   156  # Install go-swagger for validating swagger.yaml
   157  ENV GO_SWAGGER_COMMIT c28258affb0b6251755d92489ef685af8d4ff3eb
   158  RUN set -x \
   159  	&& export GOPATH="$(mktemp -d)" \
   160  	&& git clone https://github.com/go-swagger/go-swagger.git "$GOPATH/src/github.com/go-swagger/go-swagger" \
   161  	&& (cd "$GOPATH/src/github.com/go-swagger/go-swagger" && git checkout -q "$GO_SWAGGER_COMMIT") \
   162  	&& go build -o /usr/local/bin/swagger github.com/go-swagger/go-swagger/cmd/swagger \
   163  	&& rm -rf "$GOPATH"
   164  
   165  # Set user.email so crosbymichael's in-container merge commits go smoothly
   166  RUN git config --global user.email 'docker-dummy@example.com'
   167  
   168  # Add an unprivileged user to be used for tests which need it
   169  RUN groupadd -r docker
   170  RUN useradd --create-home --gid docker unprivilegeduser
   171  
   172  VOLUME /var/lib/docker
   173  WORKDIR /go/src/github.com/docker/docker
   174  ENV DOCKER_BUILDTAGS apparmor seccomp selinux
   175  
   176  # Let us use a .bashrc file
   177  RUN ln -sfv $PWD/.bashrc ~/.bashrc
   178  # Add integration helps to bashrc
   179  RUN echo "source $PWD/hack/make/.integration-test-helpers" >> /etc/bash.bashrc
   180  
   181  # Get useful and necessary Hub images so we can "docker load" locally instead of pulling
   182  COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
   183  RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
   184  	buildpack-deps:jessie@sha256:dd86dced7c9cd2a724e779730f0a53f93b7ef42228d4344b25ce9a42a1486251 \
   185  	busybox:latest@sha256:bbc3a03235220b170ba48a157dd097dd1379299370e1ed99ce976df0355d24f0 \
   186  	busybox:glibc@sha256:0b55a30394294ab23b9afd58fab94e61a923f5834fba7ddbae7f8e0c11ba85e6 \
   187  	debian:jessie@sha256:287a20c5f73087ab406e6b364833e3fb7b3ae63ca0eb3486555dc27ed32c6e60 \
   188  	hello-world:latest@sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c
   189  # See also ensureFrozenImagesLinux() in "integration-cli/fixtures_linux_daemon_test.go" (which needs to be updated when adding images to this list)
   190  
   191  # Install tomlv, vndr, runc, containerd, tini, proxy dockercli
   192  # Please edit hack/dockerfile/install/<name>.installer to update them.
   193  COPY hack/dockerfile/install hack/dockerfile/install
   194  RUN for i in tomlv vndr tini gometalinter proxy dockercli runc containerd; \
   195  		do hack/dockerfile/install/install.sh $i; \
   196  	done
   197  ENV PATH=/usr/local/cli:$PATH
   198  
   199  # Activate bash completion and include Docker's completion if mounted with DOCKER_BASH_COMPLETION_PATH
   200  RUN echo "source /usr/share/bash-completion/bash_completion" >> /etc/bash.bashrc
   201  RUN ln -s /usr/local/completion/bash/docker /etc/bash_completion.d/docker
   202  
   203  # Wrap all commands in the "docker-in-docker" script to allow nested containers
   204  ENTRYPOINT ["hack/dind"]
   205  
   206  # Options for hack/validate/gometalinter
   207  ENV GOMETALINTER_OPTS="--deadline=2m"
   208  
   209  # Upload docker source
   210  COPY . /go/src/github.com/docker/docker
   211