Browse code

devmapper gd: disable for static build

Static build with devmapper is impossible now since libudev is required
and no static version of libudev is available (as static libraries are
not supported by systemd which udev is part of).

This should not hurt anyone as "[t]he primary user of static builds
is the Editions, and docker in docker via the containers, and none
of those use device mapper".

Also, since the need for static libdevmapper is gone, there is no need
to self-compile libdevmapper -- let's use the one from Debian Stretch.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>

Kir Kolyshkin authored on 2017/08/18 18:48:55
Showing 7 changed files
... ...
@@ -51,6 +51,7 @@ RUN apt-get update && apt-get install -y \
51 51
 	less \
52 52
 	libapparmor-dev \
53 53
 	libcap-dev \
54
+	libdevmapper-dev \
54 55
 	libnl-3-dev \
55 56
 	libprotobuf-c0-dev \
56 57
 	libprotobuf-dev \
... ...
@@ -76,22 +77,6 @@ RUN apt-get update && apt-get install -y \
76 76
 	--no-install-recommends \
77 77
 	&& pip install awscli==1.10.15
78 78
 
79
-# Get lvm2 sources to build statically linked devmapper library
80
-ENV LVM2_VERSION 2.02.168
81
-RUN mkdir -p /usr/local/lvm2 \
82
-	&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
83
-		| tar -xzC /usr/local/lvm2 --strip-components=1
84
-
85
-# Compile and install (only the needed library)
86
-RUN cd /usr/local/lvm2 \
87
-	&& ./configure \
88
-		--build="$(gcc -print-multiarch)" \
89
-		--enable-static_link \
90
-		--enable-pkgconfig \
91
-		--enable-udev_sync \
92
-	&& make -C include \
93
-	&& make -C libdm install_device-mapper
94
-
95 79
 # Install seccomp: the version shipped upstream is too old
96 80
 ENV SECCOMP_VERSION 2.3.2
97 81
 RUN set -x \
... ...
@@ -44,6 +44,7 @@ RUN apt-get update && apt-get install -y \
44 44
 	less \
45 45
 	libapparmor-dev \
46 46
 	libcap-dev \
47
+	libdevmapper-dev \
47 48
 	libnl-3-dev \
48 49
 	libprotobuf-c0-dev \
49 50
 	libprotobuf-dev \
... ...
@@ -68,22 +69,6 @@ RUN apt-get update && apt-get install -y \
68 68
 	zip \
69 69
 	--no-install-recommends
70 70
 
71
-# Get lvm2 sources to build statically linked devmapper library
72
-ENV LVM2_VERSION 2.02.168
73
-RUN mkdir -p /usr/local/lvm2 \
74
-	&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
75
-		| tar -xzC /usr/local/lvm2 --strip-components=1
76
-
77
-# Compile and install (only the needed library)
78
-RUN cd /usr/local/lvm2 \
79
-	&& ./configure \
80
-		--build="$(gcc -print-multiarch)" \
81
-		--enable-static_link \
82
-		--enable-pkgconfig \
83
-		--enable-udev_sync \
84
-	&& make -C include \
85
-	&& make -C libdm install_device-mapper
86
-
87 71
 # Install seccomp: the version shipped upstream is too old
88 72
 ENV SECCOMP_VERSION 2.3.2
89 73
 RUN set -x \
... ...
@@ -39,6 +39,7 @@ RUN apt-get update && apt-get install -y \
39 39
 	net-tools \
40 40
 	libapparmor-dev \
41 41
 	libcap-dev \
42
+	libdevmapper-dev \
42 43
 	libsystemd-dev \
43 44
 	libtool \
44 45
 	libudev-dev \
... ...
@@ -56,23 +57,6 @@ RUN apt-get update && apt-get install -y \
56 56
 	--no-install-recommends \
57 57
 	&& pip install awscli==1.10.15
58 58
 
59
-# Get lvm2 sources to build statically linked devmapper library
60
-ENV LVM2_VERSION 2.02.168
61
-RUN mkdir -p /usr/local/lvm2 \
62
-	&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
63
-		| tar -xzC /usr/local/lvm2 --strip-components=1
64
-
65
-# Compile and install (only the needed library)
66
-RUN cd /usr/local/lvm2 \
67
-	&& ./configure \
68
-		--build="$(gcc -print-multiarch)" \
69
-		--enable-static_link \
70
-		--enable-pkgconfig \
71
-		--enable-udev_sync \
72
-	&& make -C include \
73
-	&& make -C libdm install_device-mapper
74
-
75
-
76 59
 # Install Go
77 60
 # IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored
78 61
 ENV GO_VERSION 1.8.3
... ...
@@ -40,6 +40,7 @@ RUN apt-get update && apt-get install -y \
40 40
 	net-tools \
41 41
 	libapparmor-dev \
42 42
 	libcap-dev \
43
+	libdevmapper-dev \
43 44
 	libsystemd-dev \
44 45
 	libtool \
45 46
 	libudev-dev \
... ...
@@ -56,22 +57,6 @@ RUN apt-get update && apt-get install -y \
56 56
 	vim-common \
57 57
 	--no-install-recommends
58 58
 
59
-# Get lvm2 sources to build statically linked devmapper library
60
-ENV LVM2_VERSION 2.02.168
61
-RUN mkdir -p /usr/local/lvm2 \
62
-	&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
63
-		| tar -xzC /usr/local/lvm2 --strip-components=1
64
-
65
-# Compile and install (only the needed library)
66
-RUN cd /usr/local/lvm2 \
67
-	&& ./configure \
68
-		--build="$(gcc -print-multiarch)" \
69
-		--enable-static_link \
70
-		--enable-pkgconfig \
71
-		--enable-udev_sync \
72
-	&& make -C include \
73
-	&& make -C libdm install_device-mapper
74
-
75 59
 # Install seccomp: the version shipped upstream is too old
76 60
 ENV SECCOMP_VERSION 2.3.2
77 61
 RUN set -x \
... ...
@@ -36,6 +36,7 @@ RUN apt-get update && apt-get install -y \
36 36
 	net-tools \
37 37
 	libapparmor-dev \
38 38
 	libcap-dev \
39
+	libdevmapper-dev \
39 40
 	libsystemd-dev \
40 41
 	libtool \
41 42
 	libudev-dev \
... ...
@@ -67,22 +68,6 @@ RUN set -x \
67 67
 	) \
68 68
 	&& rm -rf "$SECCOMP_PATH"
69 69
 
70
-# Get lvm2 sources to build statically linked devmapper library
71
-ENV LVM2_VERSION 2.02.168
72
-RUN mkdir -p /usr/local/lvm2 \
73
-	&& curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \
74
-		| tar -xzC /usr/local/lvm2 --strip-components=1
75
-
76
-# Compile and install (only the needed library)
77
-RUN cd /usr/local/lvm2 \
78
-	&& ./configure \
79
-		--build="$(gcc -print-multiarch)" \
80
-		--enable-static_link \
81
-		--enable-pkgconfig \
82
-		--enable-udev_sync \
83
-	&& make -C include \
84
-	&& make -C libdm install_device-mapper
85
-
86 70
 # IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored
87 71
 ENV GO_VERSION 1.8.3
88 72
 RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-s390x.tar.gz" \
... ...
@@ -1,4 +1,4 @@
1
-// +build !exclude_graphdriver_devicemapper,linux
1
+// +build !exclude_graphdriver_devicemapper,!static_build,linux
2 2
 
3 3
 package register
4 4
 
5 5
deleted file mode 100644
... ...
@@ -1,6 +0,0 @@
1
-// +build linux,cgo,static_build
2
-
3
-package devicemapper
4
-
5
-// #cgo pkg-config: --static devmapper
6
-import "C"