2015-08-17 05:20:45 -04:00
|
|
|
# This file describes the standard way to build Docker, using docker
|
|
|
|
#
|
|
|
|
# Usage:
|
|
|
|
#
|
|
|
|
# # Assemble the full dev environment. This is slow the first time.
|
|
|
|
# docker build -t docker -f Dockerfile.gccgo .
|
|
|
|
#
|
|
|
|
|
2016-05-19 15:13:35 -04:00
|
|
|
FROM gcc:6.1
|
2015-08-17 05:20:45 -04:00
|
|
|
|
|
|
|
# Packaged dependencies
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
apparmor \
|
|
|
|
aufs-tools \
|
|
|
|
btrfs-tools \
|
|
|
|
build-essential \
|
|
|
|
curl \
|
|
|
|
git \
|
|
|
|
iptables \
|
2015-12-02 11:43:41 -05:00
|
|
|
jq \
|
2015-08-17 05:20:45 -04:00
|
|
|
net-tools \
|
|
|
|
libapparmor-dev \
|
|
|
|
libcap-dev \
|
|
|
|
libsqlite3-dev \
|
|
|
|
mercurial \
|
2016-02-12 11:56:11 -05:00
|
|
|
net-tools \
|
2015-08-17 05:20:45 -04:00
|
|
|
parallel \
|
2015-11-22 05:32:10 -05:00
|
|
|
python-dev \
|
2015-08-17 05:20:45 -04:00
|
|
|
python-mock \
|
|
|
|
python-pip \
|
|
|
|
python-websocket \
|
|
|
|
--no-install-recommends
|
|
|
|
|
|
|
|
# Get lvm2 source for compiling statically
|
|
|
|
RUN git clone -b v2_02_103 https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2
|
|
|
|
# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
|
|
|
|
|
|
|
|
# Compile and install lvm2
|
|
|
|
RUN cd /usr/local/lvm2 \
|
|
|
|
&& ./configure --enable-static_link \
|
|
|
|
&& make device-mapper \
|
|
|
|
&& make install_device-mapper
|
|
|
|
# see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
|
|
|
|
|
2016-02-02 12:56:29 -05:00
|
|
|
# install seccomp: the version shipped in jessie is too old
|
2016-05-24 16:39:52 -04:00
|
|
|
ENV SECCOMP_VERSION v2.3.1
|
2015-12-07 20:40:55 -05:00
|
|
|
RUN set -x \
|
|
|
|
&& export SECCOMP_PATH=$(mktemp -d) \
|
|
|
|
&& git clone https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \
|
|
|
|
&& ( \
|
|
|
|
cd "$SECCOMP_PATH" \
|
|
|
|
&& git checkout "$SECCOMP_VERSION" \
|
|
|
|
&& ./autogen.sh \
|
|
|
|
&& ./configure --prefix=/usr \
|
|
|
|
&& make \
|
|
|
|
&& make install \
|
|
|
|
) \
|
|
|
|
&& rm -rf "$SECCOMP_PATH"
|
|
|
|
|
2015-08-17 05:20:45 -04:00
|
|
|
ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
|
|
|
|
|
|
|
|
# Get the "docker-py" source so we can run their integration tests
|
2016-03-14 23:12:09 -04:00
|
|
|
ENV DOCKER_PY_COMMIT 7befe694bd21e3c54bb1d7825270ea4bd6864c13
|
2015-08-17 05:20:45 -04:00
|
|
|
RUN git clone https://github.com/docker/docker-py.git /docker-py \
|
|
|
|
&& cd /docker-py \
|
|
|
|
&& git checkout -q $DOCKER_PY_COMMIT
|
|
|
|
|
|
|
|
# Add an unprivileged user to be used for tests which need it
|
|
|
|
RUN groupadd -r docker
|
|
|
|
RUN useradd --create-home --gid docker unprivilegeduser
|
|
|
|
|
|
|
|
VOLUME /var/lib/docker
|
|
|
|
WORKDIR /go/src/github.com/docker/docker
|
2015-12-07 20:40:55 -05:00
|
|
|
ENV DOCKER_BUILDTAGS apparmor seccomp selinux
|
2015-08-17 05:20:45 -04:00
|
|
|
|
2016-03-18 14:50:19 -04:00
|
|
|
# Install runc
|
2016-06-15 17:57:34 -04:00
|
|
|
ENV RUNC_COMMIT cc29e3dded8e27ba8f65738f40d251c885030a28
|
2016-03-18 14:50:19 -04:00
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
2016-06-15 17:57:34 -04:00
|
|
|
&& git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc" \
|
2016-03-18 14:50:19 -04:00
|
|
|
&& cd "$GOPATH/src/github.com/opencontainers/runc" \
|
|
|
|
&& git checkout -q "$RUNC_COMMIT" \
|
2016-03-22 20:55:47 -04:00
|
|
|
&& make static BUILDTAGS="seccomp apparmor selinux" \
|
2016-04-15 00:45:35 -04:00
|
|
|
&& cp runc /usr/local/bin/docker-runc \
|
|
|
|
&& rm -rf "$GOPATH"
|
2016-03-18 14:50:19 -04:00
|
|
|
|
|
|
|
# Install containerd
|
2016-09-23 17:17:44 -04:00
|
|
|
ENV CONTAINERD_COMMIT v0.2.4
|
2016-03-18 14:50:19 -04:00
|
|
|
RUN set -x \
|
|
|
|
&& export GOPATH="$(mktemp -d)" \
|
2016-03-29 03:35:42 -04:00
|
|
|
&& git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd" \
|
2016-03-18 14:50:19 -04:00
|
|
|
&& cd "$GOPATH/src/github.com/docker/containerd" \
|
|
|
|
&& git checkout -q "$CONTAINERD_COMMIT" \
|
2016-03-22 20:55:47 -04:00
|
|
|
&& make static \
|
|
|
|
&& cp bin/containerd /usr/local/bin/docker-containerd \
|
|
|
|
&& cp bin/containerd-shim /usr/local/bin/docker-containerd-shim \
|
2016-04-15 00:45:35 -04:00
|
|
|
&& cp bin/ctr /usr/local/bin/docker-containerd-ctr \
|
|
|
|
&& rm -rf "$GOPATH"
|
2016-03-18 14:50:19 -04:00
|
|
|
|
2015-08-17 05:20:45 -04:00
|
|
|
# Wrap all commands in the "docker-in-docker" script to allow nested containers
|
|
|
|
ENTRYPOINT ["hack/dind"]
|
|
|
|
|
|
|
|
# Upload docker source
|
|
|
|
COPY . /go/src/github.com/docker/docker
|