Browse code

Merge pull request #18728 from hypriot/update-dockerfile-for-arm

update Dockerfile.arm to reflect latest changes in main Dockerfile

Tianon Gravi authored on 2015/12/30 02:24:29
Showing 4 changed files
... ...
@@ -39,18 +39,22 @@ RUN apt-get update && apt-get install -y \
39 39
 	dpkg-sig \
40 40
 	git \
41 41
 	iptables \
42
+	jq \
42 43
 	libapparmor-dev \
43 44
 	libcap-dev \
45
+	libltdl-dev \
44 46
 	libsqlite3-dev \
45 47
 	libsystemd-journal-dev \
48
+	libtool \
46 49
 	mercurial \
47
-	parallel \
48 50
 	pkg-config \
49 51
 	python-dev \
50 52
 	python-mock \
51 53
 	python-pip \
52 54
 	python-websocket \
53 55
 	s3cmd=1.1.0* \
56
+	xfsprogs \
57
+	tar \
54 58
 	--no-install-recommends
55 59
 
56 60
 # Get lvm2 source for compiling statically
... ...
@@ -96,6 +100,23 @@ RUN git clone https://github.com/golang/lint.git /go/src/github.com/golang/lint
96 96
 	&& (cd /go/src/github.com/golang/lint && git checkout -q $GO_LINT_COMMIT) \
97 97
 	&& go install -v github.com/golang/lint/golint
98 98
 
99
+# install seccomp
100
+# this can be changed to the ubuntu package libseccomp-dev if dockerinit is removed,
101
+# we need libseccomp.a (which the package does not provide) for dockerinit
102
+ENV SECCOMP_VERSION v2.2.3
103
+RUN set -x \
104
+	&& export SECCOMP_PATH=$(mktemp -d) \
105
+	&& git clone https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \
106
+	&& ( \
107
+		cd "$SECCOMP_PATH" \
108
+		&& git checkout "$SECCOMP_VERSION" \
109
+		&& ./autogen.sh \
110
+		&& ./configure --prefix=/usr \
111
+		&& make \
112
+		&& make install \
113
+	) \
114
+	&& rm -rf "$SECCOMP_PATH"
115
+
99 116
 # Install registry
100 117
 ENV REGISTRY_COMMIT ec87e9b6971d831f0eff752ddb54fb64693e51cd
101 118
 RUN set -x \
... ...
@@ -140,7 +161,7 @@ RUN useradd --create-home --gid docker unprivilegeduser
140 140
 
141 141
 VOLUME /var/lib/docker
142 142
 WORKDIR /go/src/github.com/docker/docker
143
-ENV DOCKER_BUILDTAGS apparmor selinux
143
+ENV DOCKER_BUILDTAGS apparmor seccomp selinux
144 144
 
145 145
 # Let us use a .bashrc file
146 146
 RUN ln -sfv $PWD/.bashrc ~/.bashrc
... ...
@@ -149,18 +170,18 @@ RUN ln -sfv $PWD/.bashrc ~/.bashrc
149 149
 RUN ln -sv $PWD/contrib/completion/bash/docker /etc/bash_completion.d/docker
150 150
 
151 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
152
+COPY contrib/download-frozen-image-v2.sh /go/src/github.com/docker/docker/contrib/
153
+RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \
154
+  hypriot/armhf-busybox:latest@sha256:b0fc94dac9793ce3c35607b15012b4c7deca300963a7cc38ab440189ec81e2e7 \
155
+  hypriot/armhf-hello-world:latest@sha256:b618ec0cc3acf683e8d77ad6c5ec81546cddde2036eda9a78f628effdeca74cd \
156
+  hypriot/armhf-unshare:latest@sha256:8fede091760d2fb8b2d14cedffdd681c4575b02b1abeeb18dd79b754c62327db
157 157
 # see also "hack/make/.ensure-frozen-images" (which needs to be updated any time this list is)
158 158
 
159 159
 # Download man page generator
160 160
 RUN set -x \
161 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" \
162
+ 	&& git clone -b v1.0.4 https://github.com/cpuguy83/go-md2man.git "$GOPATH/src/github.com/cpuguy83/go-md2man" \
163
+	&& git clone -b v1.4 https://github.com/russross/blackfriday.git "$GOPATH/src/github.com/russross/blackfriday" \
164 164
 	&& go get -v -d github.com/cpuguy83/go-md2man \
165 165
 	&& go build -v -o /usr/local/bin/go-md2man github.com/cpuguy83/go-md2man \
166 166
 	&& rm -rf "$GOPATH"
... ...
@@ -2,11 +2,6 @@
2 2
 
3 3
 # get OS/Arch of docker engine
4 4
 DOCKER_ENGINE_OSARCH = $(shell docker version | grep 'OS/Arch' | tail -1 | cut -d':' -f2 | tr -d '[[:space:]]')
5
-DOCKER_ENGINE_GOOS = $(word 1, $(subst /, ,$(DOCKER_ENGINE_OSARCH)))
6
-DOCKER_ENGINE_GOARCH = $(word 2, $(subst /, ,$(DOCKER_ENGINE_OSARCH)))
7
-export DOCKER_ENGINE_OSARCH
8
-export DOCKER_ENGINE_GOOS
9
-export DOCKER_ENGINE_GOARCH
10 5
 # default for linux/amd64 and others
11 6
 DOCKER_FILE = Dockerfile
12 7
 # switch to different Dockerfile for linux/arm
... ...
@@ -22,9 +17,6 @@ DOCKER_ENVS := \
22 22
 	-e BUILDFLAGS \
23 23
 	-e DOCKER_CLIENTONLY \
24 24
 	-e DOCKER_DEBUG \
25
-	-e DOCKER_ENGINE_GOARCH \
26
-	-e DOCKER_ENGINE_GOOS \
27
-	-e DOCKER_ENGINE_OSARCH \
28 25
 	-e DOCKER_EXPERIMENTAL \
29 26
 	-e DOCKER_FILE \
30 27
 	-e DOCKER_GRAPHDRIVER \
... ...
@@ -5,9 +5,9 @@ set -e
5 5
 case "$DOCKER_ENGINE_OSARCH" in
6 6
 	linux/arm)
7 7
 		images=(
8
-			hypriot/armhf-busybox@ea0800bb83571c585c5652b53668e76b29c7c0eef719892f9d0a48607984f9e1
9
-			hypriot/armhf-hello-world@508c59a4f8b23c77bbcf43296c3f580873dc7eecb1f0d680cea3067e221fd4c2
10
-			hypriot/armhf-unshare@3f1db65f8bbabc743fd739cf7145a56c35b2a0979ae3174e9d79b7fa4b00fca1
8
+			hypriot/armhf-busybox:latest
9
+			hypriot/armhf-hello-world:latest
10
+			hypriot/armhf-unshare:latest
11 11
 		)
12 12
 		;;
13 13
 	linux/ppc64le)
... ...
@@ -1,5 +1,12 @@
1 1
 #!/bin/bash
2 2
 
3
+# Retrieve OS/ARCH of docker daemon, eg. linux/amd64
4
+export DOCKER_ENGINE_OSARCH=$(docker version | grep 'OS/Arch' | tail -1 | cut -d':' -f2 | tr -d '[[:space:]]')
5
+# Retrieve OS of docker daemon, eg. linux
6
+export DOCKER_ENGINE_GOOS=$(echo $DOCKER_ENGINE_OSARCH | cut -d'/' -f1)
7
+# Retrieve ARCH of docker daemon, eg. amd64
8
+export DOCKER_ENGINE_GOARCH=$(echo $DOCKER_ENGINE_OSARCH | cut -d'/' -f2)
9
+
3 10
 bundle .ensure-emptyfs
4 11
 bundle .ensure-frozen-images
5 12
 bundle .ensure-httpserver