Skip to content

Commit

Permalink
Merge pull request #2283 from mtrmac/no-devmapper
Browse files Browse the repository at this point in the history
Hard-code the device-mapper graph driver to disabled
  • Loading branch information
mtrmac authored Apr 11, 2024
2 parents a694164 + 8d04b4a commit b8e0096
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 24 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,9 @@ MANPAGES_MD = $(wildcard docs/*.md)
MANPAGES ?= $(MANPAGES_MD:%.md=%)

BTRFS_BUILD_TAG = $(shell hack/btrfs_tag.sh) $(shell hack/btrfs_installed_tag.sh)
LIBDM_BUILD_TAG = $(shell hack/libdm_tag.sh)
LIBSUBID_BUILD_TAG = $(shell hack/libsubid_tag.sh)
LOCAL_BUILD_TAGS = $(BTRFS_BUILD_TAG) $(LIBDM_BUILD_TAG) $(LIBSUBID_BUILD_TAG)
BUILDTAGS += $(LOCAL_BUILD_TAGS)
LOCAL_BUILD_TAGS = $(BTRFS_BUILD_TAG) $(LIBSUBID_BUILD_TAG)
BUILDTAGS += exclude_graphdriver_devicemapper $(LOCAL_BUILD_TAGS)

ifeq ($(DISABLE_CGO), 1)
override BUILDTAGS = exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp
Expand Down
14 changes: 0 additions & 14 deletions hack/libdm_tag.sh

This file was deleted.

10 changes: 5 additions & 5 deletions install.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ Install the necessary dependencies:

```bash
# Fedora:
sudo dnf install gpgme-devel libassuan-devel btrfs-progs-devel device-mapper-devel
sudo dnf install gpgme-devel libassuan-devel btrfs-progs-devel
```

```bash
# Ubuntu (`libbtrfs-dev` requires Ubuntu 18.10 and above):
sudo apt install libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config
sudo apt install libgpgme-dev libassuan-dev libbtrfs-dev pkg-config
```

```bash
Expand All @@ -172,12 +172,12 @@ brew install gpgme

```bash
# openSUSE:
sudo zypper install libgpgme-devel device-mapper-devel libbtrfs-devel glib2-devel
sudo zypper install libgpgme-devel libbtrfs-devel glib2-devel
```

```bash
# Arch Linux:
sudo pacman -S base-devel gpgme device-mapper btrfs-progs
sudo pacman -S base-devel gpgme btrfs-progs
```

Make sure to clone this repository in your `GOPATH` - otherwise compilation fails.
Expand Down Expand Up @@ -267,7 +267,7 @@ sudo make install
### Building a static binary

There have been efforts in the past to produce and maintain static builds, but the maintainers prefer to run Skopeo using distro packages or within containers. This is because static builds of Skopeo tend to be unreliable and functionally restricted. Specifically:
- Some features of Skopeo depend on non-Go libraries like `libgpgme` and `libdevmapper`.
- Some features of Skopeo depend on non-Go libraries like `libgpgme`.
- Generating static Go binaries uses native Go libraries, which don't support e.g. `.local` or LDAP-based name resolution.

That being said, if you would like to build Skopeo statically, you might be able to do it by combining all the following steps.
Expand Down
3 changes: 1 addition & 2 deletions rpm/skopeo.spec
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ BuildRequires: go-rpm-macros
%endif
BuildRequires: gpgme-devel
BuildRequires: libassuan-devel
BuildRequires: pkgconfig(devmapper)
BuildRequires: ostree-devel
BuildRequires: glib2-devel
BuildRequires: make
Expand Down Expand Up @@ -119,7 +118,7 @@ CGO_CFLAGS=$(echo $CGO_CFLAGS | sed 's/-specs=\/usr\/lib\/rpm\/redhat\/redhat-an
export CGO_CFLAGS="$CGO_CFLAGS -m64 -mtune=generic -fcf-protection=full"
%endif

BASEBUILDTAGS="$(hack/libdm_tag.sh) $(hack/libsubid_tag.sh)"
BASEBUILDTAGS="exclude_graphdriver_devicemapper $(hack/libsubid_tag.sh)"
%if %{defined build_with_btrfs}
export BUILDTAGS="$BASEBUILDTAGS $(hack/btrfs_tag.sh) $(hack/btrfs_installed_tag.sh)"
%else
Expand Down

0 comments on commit b8e0096

Please sign in to comment.