9f1fc40a |
# This file describes the standard way to build Docker, using docker |
fa806f26 |
#
# Usage:
#
# # Assemble the full dev environment. This is slow the first time.
# docker build -t docker .
# |
d757bd09 |
# # Mount your source in an interactive container for quick testing: |
b3ee9ac7 |
# docker run -v `pwd`:/go/src/github.com/docker/docker --privileged -i -t docker bash |
d757bd09 |
# |
fa806f26 |
# # Run the test suite: |
44fe8cbb |
# docker run --privileged docker hack/make.sh test |
fa806f26 |
#
# # Publish a release: |
44fe8cbb |
# docker run --privileged \ |
ccefe478 |
# -e AWS_S3_BUCKET=baz \
# -e AWS_ACCESS_KEY=foo \
# -e AWS_SECRET_KEY=bar \
# -e GPG_PASSPHRASE=gloubiboulga \
# docker hack/release.sh
# |
31638ab2 |
# Note: Apparmor used to mess with privileged mode, but this is no longer
# the case. Therefore, you don't have to disable it anymore.
# |
fa806f26 |
|
46a47f0d |
FROM ubuntu:14.04 |
484a75f3 |
MAINTAINER Tianon Gravi <admwiggin@gmail.com> (@tianon) |
ccefe478 |
|
484a75f3 |
# Packaged dependencies |
fc637b52 |
RUN apt-get update && apt-get install -y \ |
484a75f3 |
aufs-tools \ |
94566b74 |
automake \ |
6922f1be |
btrfs-tools \ |
484a75f3 |
build-essential \
curl \
dpkg-sig \
git \
iptables \ |
94566b74 |
libapparmor-dev \
libcap-dev \ |
484a75f3 |
libsqlite3-dev \ |
94f01184 |
lxc=1.0* \ |
484a75f3 |
mercurial \ |
81e78db5 |
parallel \ |
484a75f3 |
reprepro \
ruby1.9.1 \
ruby1.9.1-dev \
s3cmd=1.1.0* \
--no-install-recommends
# Get lvm2 source for compiling statically |
94566b74 |
RUN git clone --no-checkout https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2 && cd /usr/local/lvm2 && git checkout -q v2_02_103 |
484a75f3 |
# see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags |
94566b74 |
# note: we don't use "git clone -b" above because it then spews big nasty warnings about 'detached HEAD' state that we can't silence as easily as we can silence them using "git checkout" directly |
484a75f3 |
# 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 |
ccefe478 |
|
1cbdaeba |
# Install Go |
da34672d |
RUN curl -sSL https://golang.org/dl/go1.3.3.src.tar.gz | tar -v -C /usr/local -xz |
484a75f3 |
ENV PATH /usr/local/go/bin:$PATH |
b3ee9ac7 |
ENV GOPATH /go:/go/src/github.com/docker/docker/vendor |
3f136dc0 |
ENV PATH /go/bin:$PATH |
62a81370 |
RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1
|
484a75f3 |
# Compile Go for cross compilation |
cf655ca9 |
ENV DOCKER_CROSSPLATFORMS \
linux/386 linux/arm \
darwin/amd64 darwin/386 \ |
750dc335 |
freebsd/amd64 freebsd/386 freebsd/arm
# windows is experimental for now
# windows/amd64 windows/386
|
065dd231 |
# (set an explicit GOARM of 5 for maximum compatibility)
ENV GOARM 5 |
62a81370 |
RUN cd /usr/local/go/src && bash -xc 'for platform in $DOCKER_CROSSPLATFORMS; do GOOS=${platform%/*} GOARCH=${platform##*/} ./make.bash --no-clean 2>&1; done' |
ccefe478 |
|
59dc2876 |
# Grab Go's cover tool for dead-simple code coverage testing |
b4336803 |
RUN go get golang.org/x/tools/cmd/cover |
59dc2876 |
|
484a75f3 |
# TODO replace FPM with some very minimal debhelper stuff |
03f67aa4 |
RUN gem install --no-rdoc --no-ri fpm --version 1.3.2 |
484a75f3 |
|
3f136dc0 |
# Install man page generator
RUN mkdir -p /go/src/github.com/cpuguy83 \
&& git clone -b v1 https://github.com/cpuguy83/go-md2man.git /go/src/github.com/cpuguy83/go-md2man \
&& cd /go/src/github.com/cpuguy83/go-md2man \
&& go get -v ./...
|
7bb72fa0 |
# Get the "busybox" image source so we can build locally instead of pulling |
efa79a09 |
RUN git clone -b buildroot-2014.02 https://github.com/jpetazzo/docker-busybox.git /docker-busybox |
7bb72fa0 |
|
9e5592d6 |
# Get the "cirros" image source so we can import it instead of fetching it during tests
RUN curl -sSL -o /cirros.tar.gz https://github.com/ewindisch/docker-cirros/raw/1cded459668e8b9dbf4ef976c94c05add9bbd8e9/cirros-0.3.0-x86_64-lxc.tar.gz
|
484a75f3 |
# Setup s3cmd config |
e0a1df8e |
RUN /bin/echo -e '[default]\naccess_key=$AWS_ACCESS_KEY\nsecret_key=$AWS_SECRET_KEY' > $HOME/.s3cfg |
484a75f3 |
|
94c5f51c |
# Set user.email so crosbymichael's in-container merge commits go smoothly
RUN git config --global user.email 'docker-dummy@example.com'
|
599cb12b |
# Add an unprivileged user to be used for tests which need it |
886d3c93 |
RUN groupadd -r docker
RUN useradd --create-home --gid docker unprivilegeduser |
599cb12b |
|
7f1a9112 |
VOLUME /var/lib/docker |
b3ee9ac7 |
WORKDIR /go/src/github.com/docker/docker |
d7c37b5a |
ENV DOCKER_BUILDTAGS apparmor selinux btrfs_noversion |
ccefe478 |
|
34eab428 |
# Wrap all commands in the "docker-in-docker" script to allow nested containers |
7f1a9112 |
ENTRYPOINT ["hack/dind"] |
ccefe478 |
|
47838051 |
# Upload docker source |
b3ee9ac7 |
COPY . /go/src/github.com/docker/docker |