Skip to content

Commit

Permalink
devmapper gd: disable for static build
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kolyshkin committed Sep 18, 2017
1 parent e89a5e5 commit 84f1c05
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 88 deletions.
17 changes: 1 addition & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
17 changes: 1 addition & 16 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
18 changes: 1 addition & 17 deletions Dockerfile.armhf
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down
17 changes: 1 addition & 16 deletions Dockerfile.ppc64le
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
17 changes: 1 addition & 16 deletions Dockerfile.s390x
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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" \
Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/register/register_devicemapper.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !exclude_graphdriver_devicemapper,linux
// +build !exclude_graphdriver_devicemapper,!static_build,linux

package register

Expand Down
6 changes: 0 additions & 6 deletions pkg/devicemapper/devmapper_wrapper_static.go

This file was deleted.

0 comments on commit 84f1c05

Please sign in to comment.