Browse code

fix libseccomp where version < 2.2.1

Signed-off-by: Jessica Frazelle <acidburn@docker.com>

Jessica Frazelle authored on 2015/12/29 14:25:11
Showing 6 changed files
... ...
@@ -4,30 +4,7 @@
4 4
 
5 5
 FROM debian:jessie
6 6
 
7
-RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev libseccomp-dev libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
8
-
9
-ENV SECCOMP_VERSION v2.2.3
10
-RUN buildDeps=' \
11
-automake \
12
-libtool \
13
-' \
14
-&& set -x \
15
-&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
16
-&& rm -rf /var/lib/apt/lists/* \
17
-&& export SECCOMP_PATH=$(mktemp -d) \
18
-&& git clone -b "$SECCOMP_VERSION" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \
19
-&& ( \
20
-cd "$SECCOMP_PATH" \
21
-&& ./autogen.sh \
22
-&& ./configure --prefix=/usr \
23
-&& make \
24
-&& install -c src/.libs/libseccomp.a /usr/lib/libseccomp.a \
25
-&& chmod 644 /usr/lib/libseccomp.a \
26
-&& ranlib /usr/lib/libseccomp.a \
27
-&& ldconfig -n /usr/lib \
28
-) \
29
-&& rm -rf "$SECCOMP_PATH" \
30
-&& apt-get purge -y --auto-remove $buildDeps
7
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev  libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
31 8
 
32 9
 ENV GO_VERSION 1.5.2
33 10
 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
... ...
@@ -35,4 +12,4 @@ ENV PATH $PATH:/usr/local/go/bin
35 35
 
36 36
 ENV AUTO_GOPATH 1
37 37
 
38
-ENV DOCKER_BUILDTAGS apparmor seccomp selinux
38
+ENV DOCKER_BUILDTAGS apparmor selinux
... ...
@@ -68,8 +68,9 @@ for version in "${versions[@]}"; do
68 68
 	esac
69 69
 
70 70
 	# debian wheezy & ubuntu precise do not have the right libseccomp libs
71
+	# debian jessie & ubuntu trusty have a libseccomp < 2.2.1 :(
71 72
 	case "$suite" in
72
-		precise|wheezy)
73
+		precise|wheezy|jessie|trusty)
73 74
 			packages=( "${packages[@]/libseccomp-dev}" )
74 75
 			;;
75 76
 		*)
... ...
@@ -104,41 +105,6 @@ for version in "${versions[@]}"; do
104 104
 
105 105
 	echo >> "$version/Dockerfile"
106 106
 
107
-	# debian jessie & ubuntu trusty do not have a libseccomp.a for compiling static dockerinit
108
-	# ONLY install libseccomp.a from source, this can be removed once dockerinit is removed
109
-	# TODO remove this manual seccomp compilation once dockerinit is gone or no longer needs to be statically compiled
110
-	case "$suite" in
111
-		jessie|trusty)
112
-			awk '$1 == "ENV" && $2 == "SECCOMP_VERSION" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile"
113
-			cat <<-'EOF' >> "$version/Dockerfile"
114
-			RUN buildDeps=' \
115
-				automake \
116
-				libtool \
117
-			' \
118
-			&& set -x \
119
-			&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
120
-			&& rm -rf /var/lib/apt/lists/* \
121
-			&& export SECCOMP_PATH=$(mktemp -d) \
122
-			&& git clone -b "$SECCOMP_VERSION" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \
123
-			&& ( \
124
-				cd "$SECCOMP_PATH" \
125
-				&& ./autogen.sh \
126
-				&& ./configure --prefix=/usr \
127
-				&& make \
128
-				&& install -c src/.libs/libseccomp.a /usr/lib/libseccomp.a \
129
-				&& chmod 644 /usr/lib/libseccomp.a \
130
-				&& ranlib /usr/lib/libseccomp.a \
131
-				&& ldconfig -n /usr/lib \
132
-			) \
133
-			&& rm -rf "$SECCOMP_PATH" \
134
-			&& apt-get purge -y --auto-remove $buildDeps
135
-			EOF
136
-
137
-			echo >> "$version/Dockerfile"
138
-			;;
139
-		*) ;;
140
-	esac
141
-
142 107
 	awk '$1 == "ENV" && $2 == "GO_VERSION" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile"
143 108
 	echo 'RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local' >> "$version/Dockerfile"
144 109
 	echo 'ENV PATH $PATH:/usr/local/go/bin' >> "$version/Dockerfile"
... ...
@@ -4,30 +4,7 @@
4 4
 
5 5
 FROM ubuntu:trusty
6 6
 
7
-RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev libseccomp-dev libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
8
-
9
-ENV SECCOMP_VERSION v2.2.3
10
-RUN buildDeps=' \
11
-automake \
12
-libtool \
13
-' \
14
-&& set -x \
15
-&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \
16
-&& rm -rf /var/lib/apt/lists/* \
17
-&& export SECCOMP_PATH=$(mktemp -d) \
18
-&& git clone -b "$SECCOMP_VERSION" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \
19
-&& ( \
20
-cd "$SECCOMP_PATH" \
21
-&& ./autogen.sh \
22
-&& ./configure --prefix=/usr \
23
-&& make \
24
-&& install -c src/.libs/libseccomp.a /usr/lib/libseccomp.a \
25
-&& chmod 644 /usr/lib/libseccomp.a \
26
-&& ranlib /usr/lib/libseccomp.a \
27
-&& ldconfig -n /usr/lib \
28
-) \
29
-&& rm -rf "$SECCOMP_PATH" \
30
-&& apt-get purge -y --auto-remove $buildDeps
7
+RUN apt-get update && apt-get install -y apparmor bash-completion btrfs-tools build-essential curl ca-certificates debhelper dh-apparmor dh-systemd git libapparmor-dev libdevmapper-dev libltdl-dev libsqlite3-dev  libsystemd-journal-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*
31 8
 
32 9
 ENV GO_VERSION 1.5.2
33 10
 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
... ...
@@ -35,4 +12,4 @@ ENV PATH $PATH:/usr/local/go/bin
35 35
 
36 36
 ENV AUTO_GOPATH 1
37 37
 
38
-ENV DOCKER_BUILDTAGS apparmor seccomp selinux
38
+ENV DOCKER_BUILDTAGS apparmor selinux
... ...
@@ -6,28 +6,7 @@ FROM centos:7
6 6
 
7 7
 RUN yum groupinstall -y "Development Tools"
8 8
 RUN yum -y swap -- remove systemd-container systemd-container-libs -- install systemd systemd-libs
9
-RUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel selinux-policy selinux-policy-devel sqlite-devel tar
10
-
11
-ENV SECCOMP_VERSION v2.2.3
12
-RUN buildDeps=' \
13
-automake \
14
-libtool \
15
-' \
16
-&& set -x \
17
-&& yum install -y $buildDeps \
18
-&& export SECCOMP_PATH=$(mktemp -d) \
19
-&& git clone -b "$SECCOMP_VERSION" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \
20
-&& ( \
21
-cd "$SECCOMP_PATH" \
22
-&& ./autogen.sh \
23
-&& ./configure --prefix=/usr \
24
-&& make \
25
-&& install -c src/.libs/libseccomp.a /usr/lib/libseccomp.a \
26
-&& chmod 644 /usr/lib/libseccomp.a \
27
-&& ranlib /usr/lib/libseccomp.a \
28
-&& ldconfig -n /usr/lib \
29
-) \
30
-&& rm -rf "$SECCOMP_PATH"
9
+RUN yum install -y btrfs-progs-devel device-mapper-devel glibc-static  libselinux-devel libtool-ltdl-devel selinux-policy selinux-policy-devel sqlite-devel tar
31 10
 
32 11
 ENV GO_VERSION 1.5.2
33 12
 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
... ...
@@ -35,4 +14,4 @@ ENV PATH $PATH:/usr/local/go/bin
35 35
 
36 36
 ENV AUTO_GOPATH 1
37 37
 
38
-ENV DOCKER_BUILDTAGS seccomp selinux
38
+ENV DOCKER_BUILDTAGS selinux
... ...
@@ -84,8 +84,9 @@ for version in "${versions[@]}"; do
84 84
 	esac
85 85
 
86 86
 	# opensuse & oraclelinx:6 do not have the right libseccomp libs
87
+	# centos:7 and oraclelinux:7 have a libseccomp < 2.2.1 :(
87 88
 	case "$from" in
88
-		opensuse:*|oraclelinux:6)
89
+		opensuse:*|oraclelinux:*|centos:7)
89 90
 			packages=( "${packages[@]/libseccomp-devel}" )
90 91
 			;;
91 92
 		*)
... ...
@@ -106,12 +107,11 @@ for version in "${versions[@]}"; do
106 106
 
107 107
 	echo >> "$version/Dockerfile"
108 108
 
109
-	# centos, fedora, & oraclelinux:7 do not have a libseccomp.a for compiling static dockerinit
109
+	# fedora does not have a libseccomp.a for compiling static dockerinit
110 110
 	# ONLY install libseccomp.a from source, this can be removed once dockerinit is removed
111 111
 	# TODO remove this manual seccomp compilation once dockerinit is gone or no longer needs to be statically compiled
112 112
 	case "$from" in
113
-		opensuse:*|oraclelinux:6) ;;
114
-		*)
113
+		fedora:*)
115 114
 			awk '$1 == "ENV" && $2 == "SECCOMP_VERSION" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile"
116 115
 			cat <<-'EOF' >> "$version/Dockerfile"
117 116
 			RUN buildDeps=' \
... ...
@@ -137,6 +137,7 @@ for version in "${versions[@]}"; do
137 137
 
138 138
 			echo >> "$version/Dockerfile"
139 139
 			;;
140
+		*) ;;
140 141
 	esac
141 142
 
142 143
 	awk '$1 == "ENV" && $2 == "GO_VERSION" { print; exit }' ../../../Dockerfile >> "$version/Dockerfile"
... ...
@@ -5,28 +5,7 @@
5 5
 FROM oraclelinux:7
6 6
 
7 7
 RUN yum groupinstall -y "Development Tools"
8
-RUN yum install -y --enablerepo=ol7_optional_latest btrfs-progs-devel device-mapper-devel glibc-static libseccomp-devel libselinux-devel libtool-ltdl-devel selinux-policy selinux-policy-devel sqlite-devel tar
9
-
10
-ENV SECCOMP_VERSION v2.2.3
11
-RUN buildDeps=' \
12
-automake \
13
-libtool \
14
-' \
15
-&& set -x \
16
-&& yum install -y $buildDeps \
17
-&& export SECCOMP_PATH=$(mktemp -d) \
18
-&& git clone -b "$SECCOMP_VERSION" --depth 1 https://github.com/seccomp/libseccomp.git "$SECCOMP_PATH" \
19
-&& ( \
20
-cd "$SECCOMP_PATH" \
21
-&& ./autogen.sh \
22
-&& ./configure --prefix=/usr \
23
-&& make \
24
-&& install -c src/.libs/libseccomp.a /usr/lib/libseccomp.a \
25
-&& chmod 644 /usr/lib/libseccomp.a \
26
-&& ranlib /usr/lib/libseccomp.a \
27
-&& ldconfig -n /usr/lib \
28
-) \
29
-&& rm -rf "$SECCOMP_PATH"
8
+RUN yum install -y --enablerepo=ol7_optional_latest btrfs-progs-devel device-mapper-devel glibc-static  libselinux-devel libtool-ltdl-devel selinux-policy selinux-policy-devel sqlite-devel tar
30 9
 
31 10
 ENV GO_VERSION 1.5.2
32 11
 RUN curl -fSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | tar xzC /usr/local
... ...
@@ -34,4 +13,4 @@ ENV PATH $PATH:/usr/local/go/bin
34 34
 
35 35
 ENV AUTO_GOPATH 1
36 36
 
37
-ENV DOCKER_BUILDTAGS seccomp selinux
37
+ENV DOCKER_BUILDTAGS selinux