github.com/walkingsparrow/docker@v1.4.2-0.20151218153551-b708a2249bfa/Dockerfile.arm (about) 1 # This file describes the standard way to build Docker on ARM, 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.arm . 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 ioft/armhf-ubuntu:14.04 27 MAINTAINER Govinda Fichtner <govinda.fichtner@googlemail.com> (@_beagile_) 28 29 # Packaged dependencies 30 RUN apt-get update && apt-get install -y \ 31 apparmor \ 32 aufs-tools \ 33 automake \ 34 bash-completion \ 35 btrfs-tools \ 36 build-essential \ 37 createrepo \ 38 curl \ 39 dpkg-sig \ 40 git \ 41 iptables \ 42 libapparmor-dev \ 43 libcap-dev \ 44 libsqlite3-dev \ 45 libsystemd-journal-dev \ 46 mercurial \ 47 parallel \ 48 pkg-config \ 49 python-dev \ 50 python-mock \ 51 python-pip \ 52 python-websocket \ 53 s3cmd=1.1.0* \ 54 --no-install-recommends 55 56 # Get lvm2 source for compiling statically 57 RUN git clone -b v2_02_103 https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2 58 # see https://git.fedorahosted.org/cgit/lvm2.git/refs/tags for release tags 59 60 # Compile and install lvm2 61 RUN cd /usr/local/lvm2 \ 62 && ./configure --enable-static_link \ 63 && make device-mapper \ 64 && make install_device-mapper 65 # see https://git.fedorahosted.org/cgit/lvm2.git/tree/INSTALL 66 67 # Install Go 68 ENV GO_VERSION 1.4.3 69 RUN curl -sSL https://golang.org/dl/go${GO_VERSION}.src.tar.gz | tar -v -C /usr/local -xz \ 70 && mkdir -p /go/bin 71 ENV PATH /go/bin:/usr/local/go/bin:$PATH 72 ENV GOPATH /go:/go/src/github.com/docker/docker/vendor 73 # (set an explicit GOARM of 5 for maximum compatibility) 74 ENV GOARM 5 75 RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1 76 77 # Compile Go for cross compilation 78 ENV DOCKER_CROSSPLATFORMS " " 79 80 # This has been commented out and kept as reference because we don't support compiling with older Go anymore. 81 # ENV GOFMT_VERSION 1.3.3 82 # RUN curl -sSL https://storage.googleapis.com/golang/go${GOFMT_VERSION}.$(go env GOOS)-$(go env GOARCH).tar.gz | tar -C /go/bin -xz --strip-components=2 go/bin/gofmt 83 84 # Update this sha when we upgrade to go 1.5.0 85 ENV GO_TOOLS_COMMIT 069d2f3bcb68257b627205f0486d6cc69a231ff9 86 # Grab Go's cover tool for dead-simple code coverage testing 87 # Grab Go's vet tool for examining go code to find suspicious constructs 88 # and help prevent errors that the compiler might not catch 89 RUN git clone https://github.com/golang/tools.git /go/src/golang.org/x/tools \ 90 && (cd /go/src/golang.org/x/tools && git checkout -q $GO_TOOLS_COMMIT) \ 91 && go install -v golang.org/x/tools/cmd/cover \ 92 && go install -v golang.org/x/tools/cmd/vet 93 # Grab Go's lint tool 94 ENV GO_LINT_COMMIT f42f5c1c440621302702cb0741e9d2ca547ae80f 95 RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint \ 96 && (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \ 97 && go install -v github.com/golang/lint/golint 98 99 # Install registry 100 ENV REGISTRY_COMMIT ec87e9b6971d831f0eff752ddb54fb64693e51cd 101 RUN set -x \ 102 && export GOPATH="$(mktemp -d)" \ 103 && git clone https://github.com/docker/distribution.git "$GOPATH/src/github.com/docker/distribution" \ 104 && (cd "$GOPATH/src/github.com/docker/distribution" && git checkout -q "$REGISTRY_COMMIT") \ 105 && GOPATH="$GOPATH/src/github.com/docker/distribution/Godeps/_workspace:$GOPATH" \ 106 go build -o /usr/local/bin/registry-v2 github.com/docker/distribution/cmd/registry \ 107 && rm -rf "$GOPATH" 108 109 # Install notary server 110 # commented Notary temporary as we are waiting for an update of jose2go: https://github.com/docker/notary/issues/239 111 # 112 # ENV NOTARY_COMMIT 8e8122eb5528f621afcd4e2854c47302f17392f7 113 # RUN set -x \ 114 # && export GOPATH="$(mktemp -d)" \ 115 # && git clone https://github.com/docker/notary.git "$GOPATH/src/github.com/docker/notary" \ 116 # && (cd "$GOPATH/src/github.com/docker/notary" && git checkout -q "$NOTARY_COMMIT") \ 117 # && GOPATH="$GOPATH/src/github.com/docker/notary/Godeps/_workspace:$GOPATH" \ 118 # go build -o /usr/local/bin/notary-server github.com/docker/notary/cmd/notary-server \ 119 # && rm -rf "$GOPATH" 120 121 # Get the "docker-py" source so we can run their integration tests 122 ENV DOCKER_PY_COMMIT 139850f3f3b17357bab5ba3edfb745fb14043764 123 RUN git clone https://github.com/docker/docker-py.git /docker-py \ 124 && cd /docker-py \ 125 && git checkout -q $DOCKER_PY_COMMIT 126 127 # Setup s3cmd config 128 RUN { \ 129 echo '[default]'; \ 130 echo 'access_key=$AWS_ACCESS_KEY'; \ 131 echo 'secret_key=$AWS_SECRET_KEY'; \ 132 } > ~/.s3cfg 133 134 # Set user.email so crosbymichael's in-container merge commits go smoothly 135 RUN git config --global user.email 'docker-dummy@example.com' 136 137 # Add an unprivileged user to be used for tests which need it 138 RUN groupadd -r docker 139 RUN useradd --create-home --gid docker unprivilegeduser 140 141 VOLUME /var/lib/docker 142 WORKDIR /go/src/github.com/docker/docker 143 ENV DOCKER_BUILDTAGS apparmor selinux 144 145 # Let us use a .bashrc file 146 RUN ln -sfv $PWD/.bashrc ~/.bashrc 147 148 # Register Docker's bash completion. 149 RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker 150 151 # Get useful and necessary Hub images so we can "docker load" locally instead of pulling 152 COPY contrib/download-frozen-image.sh /go/src/github.com/docker/docker/contrib/ 153 RUN ./contrib/download-frozen-image.sh /docker-frozen-images \ 154 hypriot/armhf-busybox@ea0800bb83571c585c5652b53668e76b29c7c0eef719892f9d0a48607984f9e1 \ 155 hypriot/armhf-hello-world@508c59a4f8b23c77bbcf43296c3f580873dc7eecb1f0d680cea3067e221fd4c2 \ 156 hypriot/armhf-unshare@3f1db65f8bbabc743fd739cf7145a56c35b2a0979ae3174e9d79b7fa4b00fca1 157 # see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is) 158 159 # Download man page generator 160 RUN set -x \ 161 && export GOPATH="$(mktemp -d)" \ 162 && git clone -b v1.0.3 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \ 163 && git clone -b v1.2 https://github.com/russross/blackfriday.git "$GOPATH/src/github.com/russross/blackfriday" \ 164 && go get -v -d github.com/cpuguy83/go-md2man \ 165 && go build -v -o /usr/local/bin/go-md2man github.com/cpuguy83/go-md2man \ 166 && rm -rf "$GOPATH" 167 168 # Download toml validator 169 ENV TOMLV_COMMIT 9baf8a8a9f2ed20a8e54160840c492f937eeaf9a 170 RUN set -x \ 171 && export GOPATH="$(mktemp -d)" \ 172 && git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml" \ 173 && (cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT") \ 174 && go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv \ 175 && rm -rf "$GOPATH" 176 177 # Build/install the tool for embedding resources in Windows binaries 178 ENV RSRC_COMMIT e48dbf1b7fc464a9e85fcec450dddf80816b76e0 179 RUN set -x \ 180 && git clone https://github.com/akavel/rsrc.git /go/src/github.com/akavel/rsrc \ 181 && cd /go/src/github.com/akavel/rsrc \ 182 && git checkout -q $RSRC_COMMIT \ 183 && go install -v 184 185 # Wrap all commands in the "docker-in-docker" script to allow nested containers 186 ENTRYPOINT ["hack/dind"] 187 188 # Upload docker source 189 COPY . /go/src/github.com/docker/docker