github.com/stchris/docker@v1.4.2-0.20150106053530-1510a324dbd5/Dockerfile (about)

     1  # This file describes the standard way to build Docker, using docker
     2  #
     3  # Usage:
     4  #
     5  # # Assemble the full dev environment. This is slow the first time.
     6  # docker build -t docker .
     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
    13  #
    14  # # Publish a release:
    15  # docker run --privileged \
    16  #  -e AWS_S3_BUCKET=baz \
    17  #  -e AWS_ACCESS_KEY=foo \
    18  #  -e AWS_SECRET_KEY=bar \
    19  #  -e GPG_PASSPHRASE=gloubiboulga \
    20  #  docker hack/release.sh
    21  #
    22  # Note: Apparmor used to mess with privileged mode, but this is no longer
    23  # the case. Therefore, you don't have to disable it anymore.
    24  #
    25  
    26  FROM ubuntu:14.04
    27  MAINTAINER Tianon Gravi <admwiggin@gmail.com> (@tianon)
    28  
    29  # Packaged dependencies
    30  RUN apt-get update && apt-get install -y \
    31  	aufs-tools \
    32  	automake \
    33  	btrfs-tools \
    34  	build-essential \
    35  	curl \
    36  	dpkg-sig \
    37  	git \
    38  	iptables \
    39  	libapparmor-dev \
    40  	libcap-dev \
    41  	libsqlite3-dev \
    42  	lxc=1.0* \
    43  	mercurial \
    44  	parallel \
    45  	python-mock \
    46  	python-pip \
    47  	python-websocket \
    48  	reprepro \
    49  	ruby1.9.1 \
    50  	ruby1.9.1-dev \
    51  	s3cmd=1.1.0* \
    52  	--no-install-recommends
    53  
    54  # Get lvm2 source for compiling statically
    55  RUN git clone -b v2_02_103 https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2
    56  # see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags
    57  
    58  # Compile and install lvm2
    59  RUN cd /usr/local/lvm2 \
    60  	&& ./configure --enable-static_link \
    61  	&& make device-mapper \
    62  	&& make install_device-mapper
    63  # see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL
    64  
    65  # Install Go
    66  RUN curl -sSL https://golang.org/dl/go1.4.src.tar.gz | tar -v -C /usr/local -xz
    67  ENV PATH /usr/local/go/bin:$PATH
    68  ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
    69  ENV PATH /go/bin:$PATH
    70  RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1
    71  
    72  # Compile Go for cross compilation
    73  ENV DOCKER_CROSSPLATFORMS \
    74  	linux/386 linux/arm \
    75  	darwin/amd64 darwin/386 \
    76  	freebsd/amd64 freebsd/386 freebsd/arm \
    77  	windows/amd64 windows/386
    78  
    79  # (set an explicit GOARM of 5 for maximum compatibility)
    80  ENV GOARM 5
    81  RUN cd /usr/local/go/src \
    82  	&& set -x \
    83  	&& for platform in $DOCKER_CROSSPLATFORMS; do \
    84  		GOOS=${platform%/*} \
    85  		GOARCH=${platform##*/} \
    86  			./make.bash --no-clean 2>&1; \
    87  	done
    88  
    89  # reinstall standard library with netgo
    90  RUN go clean -i net && go install -tags netgo std
    91  
    92  # Grab Go's cover tool for dead-simple code coverage testing
    93  RUN go get golang.org/x/tools/cmd/cover
    94  
    95  # TODO replace FPM with some very minimal debhelper stuff
    96  RUN gem install --no-rdoc --no-ri fpm --version 1.3.2
    97  
    98  # Get the "busybox" image source so we can build locally instead of pulling
    99  RUN git clone -b buildroot-2014.02 https://github.com/jpetazzo/docker-busybox.git /docker-busybox
   100  
   101  # Get the "cirros" image source so we can import it instead of fetching it during tests
   102  RUN curl -sSL -o /cirros.tar.gz https://github.com/ewindisch/docker-cirros/raw/1cded459668e8b9dbf4ef976c94c05add9bbd8e9/cirros-0.3.0-x86_64-lxc.tar.gz
   103  
   104  # Get the "docker-py" source so we can run their integration tests
   105  RUN git clone -b 0.7.0 https://github.com/docker/docker-py.git /docker-py
   106  
   107  # Setup s3cmd config
   108  RUN { \
   109  		echo '[default]'; \
   110  		echo 'access_key=$AWS_ACCESS_KEY'; \
   111  		echo 'secret_key=$AWS_SECRET_KEY'; \
   112  	} > ~/.s3cfg
   113  
   114  # Set user.email so crosbymichael's in-container merge commits go smoothly
   115  RUN git config --global user.email 'docker-dummy@example.com'
   116  
   117  # Add an unprivileged user to be used for tests which need it
   118  RUN groupadd -r docker
   119  RUN useradd --create-home --gid docker unprivilegeduser
   120  
   121  VOLUME /var/lib/docker
   122  WORKDIR /go/src/github.com/docker/docker
   123  ENV DOCKER_BUILDTAGS apparmor selinux btrfs_noversion
   124  
   125  # Install man page generator
   126  COPY vendor /go/src/github.com/docker/docker/vendor
   127  # (copy vendor/ because go-md2man needs golang.org/x/net)
   128  RUN set -x \
   129  	&& git clone -b v1 https://github.com/cpuguy83/go-md2man.git /go/src/github.com/cpuguy83/go-md2man \
   130  	&& git clone -b v1.2 https://github.com/russross/blackfriday.git /go/src/github.com/russross/blackfriday \
   131  	&& go install -v github.com/cpuguy83/go-md2man
   132  
   133  # Wrap all commands in the "docker-in-docker" script to allow nested containers
   134  ENTRYPOINT ["hack/dind"]
   135  
   136  # Upload docker source
   137  COPY . /go/src/github.com/docker/docker