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>
This commit is contained in:
Kir Kolyshkin 2017-08-18 12:48:55 +03:00
parent e89a5e5e91
commit 84f1c054e6
7 changed files with 6 additions and 88 deletions

View file

@ -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 \

View file

@ -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 \

View file

@ -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

View file

@ -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 \

View file

@ -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" \

View file

@ -1,4 +1,4 @@
// +build !exclude_graphdriver_devicemapper,linux
// +build !exclude_graphdriver_devicemapper,!static_build,linux
package register

View file

@ -1,6 +0,0 @@
// +build linux,cgo,static_build
package devicemapper
// #cgo pkg-config: --static devmapper
import "C"