From 84f1c054e66d3999aaf2751062cda8a77925b7ae Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 18 Aug 2017 12:48:55 +0300 Subject: [PATCH] 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 --- Dockerfile | 17 +---------------- Dockerfile.aarch64 | 17 +---------------- Dockerfile.armhf | 18 +----------------- Dockerfile.ppc64le | 17 +---------------- Dockerfile.s390x | 17 +---------------- .../register/register_devicemapper.go | 2 +- pkg/devicemapper/devmapper_wrapper_static.go | 6 ------ 7 files changed, 6 insertions(+), 88 deletions(-) delete mode 100644 pkg/devicemapper/devmapper_wrapper_static.go diff --git a/Dockerfile b/Dockerfile index cdd3960dd7..81ae6f3ccc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,6 +51,7 @@ RUN apt-get update && apt-get install -y \ less \ libapparmor-dev \ libcap-dev \ + libdevmapper-dev \ libnl-3-dev \ libprotobuf-c0-dev \ libprotobuf-dev \ @@ -76,22 +77,6 @@ RUN apt-get update && apt-get install -y \ --no-install-recommends \ && pip install awscli==1.10.15 -# Get lvm2 sources to build statically linked devmapper library -ENV LVM2_VERSION 2.02.168 -RUN mkdir -p /usr/local/lvm2 \ - && curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \ - | tar -xzC /usr/local/lvm2 --strip-components=1 - -# Compile and install (only the needed library) -RUN cd /usr/local/lvm2 \ - && ./configure \ - --build="$(gcc -print-multiarch)" \ - --enable-static_link \ - --enable-pkgconfig \ - --enable-udev_sync \ - && make -C include \ - && make -C libdm install_device-mapper - # Install seccomp: the version shipped upstream is too old ENV SECCOMP_VERSION 2.3.2 RUN set -x \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index bb4b93fdf1..97b749e4e3 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -44,6 +44,7 @@ RUN apt-get update && apt-get install -y \ less \ libapparmor-dev \ libcap-dev \ + libdevmapper-dev \ libnl-3-dev \ libprotobuf-c0-dev \ libprotobuf-dev \ @@ -68,22 +69,6 @@ RUN apt-get update && apt-get install -y \ zip \ --no-install-recommends -# Get lvm2 sources to build statically linked devmapper library -ENV LVM2_VERSION 2.02.168 -RUN mkdir -p /usr/local/lvm2 \ - && curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \ - | tar -xzC /usr/local/lvm2 --strip-components=1 - -# Compile and install (only the needed library) -RUN cd /usr/local/lvm2 \ - && ./configure \ - --build="$(gcc -print-multiarch)" \ - --enable-static_link \ - --enable-pkgconfig \ - --enable-udev_sync \ - && make -C include \ - && make -C libdm install_device-mapper - # Install seccomp: the version shipped upstream is too old ENV SECCOMP_VERSION 2.3.2 RUN set -x \ diff --git a/Dockerfile.armhf b/Dockerfile.armhf index fea5227382..7582880475 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -39,6 +39,7 @@ RUN apt-get update && apt-get install -y \ net-tools \ libapparmor-dev \ libcap-dev \ + libdevmapper-dev \ libsystemd-dev \ libtool \ libudev-dev \ @@ -56,23 +57,6 @@ RUN apt-get update && apt-get install -y \ --no-install-recommends \ && pip install awscli==1.10.15 -# Get lvm2 sources to build statically linked devmapper library -ENV LVM2_VERSION 2.02.168 -RUN mkdir -p /usr/local/lvm2 \ - && curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \ - | tar -xzC /usr/local/lvm2 --strip-components=1 - -# Compile and install (only the needed library) -RUN cd /usr/local/lvm2 \ - && ./configure \ - --build="$(gcc -print-multiarch)" \ - --enable-static_link \ - --enable-pkgconfig \ - --enable-udev_sync \ - && make -C include \ - && make -C libdm install_device-mapper - - # Install Go # IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored ENV GO_VERSION 1.8.3 diff --git a/Dockerfile.ppc64le b/Dockerfile.ppc64le index 62c9fe412c..88f19933c3 100644 --- a/Dockerfile.ppc64le +++ b/Dockerfile.ppc64le @@ -40,6 +40,7 @@ RUN apt-get update && apt-get install -y \ net-tools \ libapparmor-dev \ libcap-dev \ + libdevmapper-dev \ libsystemd-dev \ libtool \ libudev-dev \ @@ -56,22 +57,6 @@ RUN apt-get update && apt-get install -y \ vim-common \ --no-install-recommends -# Get lvm2 sources to build statically linked devmapper library -ENV LVM2_VERSION 2.02.168 -RUN mkdir -p /usr/local/lvm2 \ - && curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \ - | tar -xzC /usr/local/lvm2 --strip-components=1 - -# Compile and install (only the needed library) -RUN cd /usr/local/lvm2 \ - && ./configure \ - --build="$(gcc -print-multiarch)" \ - --enable-static_link \ - --enable-pkgconfig \ - --enable-udev_sync \ - && make -C include \ - && make -C libdm install_device-mapper - # Install seccomp: the version shipped upstream is too old ENV SECCOMP_VERSION 2.3.2 RUN set -x \ diff --git a/Dockerfile.s390x b/Dockerfile.s390x index 3306949a0e..8d628c7588 100644 --- a/Dockerfile.s390x +++ b/Dockerfile.s390x @@ -36,6 +36,7 @@ RUN apt-get update && apt-get install -y \ net-tools \ libapparmor-dev \ libcap-dev \ + libdevmapper-dev \ libsystemd-dev \ libtool \ libudev-dev \ @@ -67,22 +68,6 @@ RUN set -x \ ) \ && rm -rf "$SECCOMP_PATH" -# Get lvm2 sources to build statically linked devmapper library -ENV LVM2_VERSION 2.02.168 -RUN mkdir -p /usr/local/lvm2 \ - && curl -fsSL "https://mirrors.kernel.org/sourceware/lvm2/LVM2.${LVM2_VERSION}.tgz" \ - | tar -xzC /usr/local/lvm2 --strip-components=1 - -# Compile and install (only the needed library) -RUN cd /usr/local/lvm2 \ - && ./configure \ - --build="$(gcc -print-multiarch)" \ - --enable-static_link \ - --enable-pkgconfig \ - --enable-udev_sync \ - && make -C include \ - && make -C libdm install_device-mapper - # IMPORTANT: When updating this please note that stdlib archive/tar pkg is vendored ENV GO_VERSION 1.8.3 RUN curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-s390x.tar.gz" \ diff --git a/daemon/graphdriver/register/register_devicemapper.go b/daemon/graphdriver/register/register_devicemapper.go index bb2e9ef541..09dfb71eb7 100644 --- a/daemon/graphdriver/register/register_devicemapper.go +++ b/daemon/graphdriver/register/register_devicemapper.go @@ -1,4 +1,4 @@ -// +build !exclude_graphdriver_devicemapper,linux +// +build !exclude_graphdriver_devicemapper,!static_build,linux package register diff --git a/pkg/devicemapper/devmapper_wrapper_static.go b/pkg/devicemapper/devmapper_wrapper_static.go deleted file mode 100644 index cf7f26a4c6..0000000000 --- a/pkg/devicemapper/devmapper_wrapper_static.go +++ /dev/null @@ -1,6 +0,0 @@ -// +build linux,cgo,static_build - -package devicemapper - -// #cgo pkg-config: --static devmapper -import "C"