From d6f7ae40b678c7c43d3f4f218cf0b9378ff95713 Mon Sep 17 00:00:00 2001 From: Leonardo Rochael Almeida Date: Fri, 6 Dec 2019 00:49:47 -0300 Subject: [PATCH 1/2] Simpler static build Use an ubuntu image to obtain a static libfuse without compiling. Remove the need for sharing /dev/fuse with the build container. Simpler build instructions. --- Dockerfile.simpler | 11 +++++++++++ README.md | 11 ++--------- 2 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 Dockerfile.simpler diff --git a/Dockerfile.simpler b/Dockerfile.simpler new file mode 100644 index 0000000..b8568be --- /dev/null +++ b/Dockerfile.simpler @@ -0,0 +1,11 @@ +FROM docker.io/ubuntu:rolling +WORKDIR /build +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + libc6-dev gcc g++ make automake autoconf clang pkgconf libfuse3-dev + +RUN cd fuse-overlayfs && \ + sh autogen.sh && \ + LIBS="-ldl" LDFLAGS="-static" ./configure --prefix /usr && \ + make + diff --git a/README.md b/README.md index 1e81810..9ca669d 100644 --- a/README.md +++ b/README.md @@ -47,19 +47,12 @@ the install script will usually create the device automatically; or 4. Launch the build with the command (note the single dot `.` at the end): ``` -buildah bud --device /dev/fuse -t fuse-overlayfs -f ./Dockerfile.static . +buildah bud -v $PWD:/build/fuse-overlayfs -t fuse-overlayfs -f ./Dockerfile.simpler . ``` 5. Copy the resulting binary to your host: - * if you have `podman` installed: ``` -podman run --rm --entrypoint="[]" fuse-overlayfs cat /usr/bin/fuse-overlayfs | sudo tee /usr/bin/fuse-overlayfs > /dev/null -``` - * or, if you only have `buildah` installed: -``` -container="$(buildah from fuse-overlayfs)" -buildah run "$container" cat /usr/bin/fuse-overlayfs | sudo tee /usr/bin/fuse-overlayfs > /dev/null -buildah rm "$container" +sudo cp fuse-overlayfs /usr/bin/ ``` From 1956d59152abe0a404093c4f6431465e76cabc30 Mon Sep 17 00:00:00 2001 From: Leonardo Rochael Almeida Date: Mon, 9 Dec 2019 15:09:23 -0300 Subject: [PATCH 2/2] Rename static dockerfiles to reflect their distros --- Dockerfile.static => Dockerfile.static.fedora | 0 Dockerfile.simpler => Dockerfile.static.ubuntu | 0 README.md | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename Dockerfile.static => Dockerfile.static.fedora (100%) rename Dockerfile.simpler => Dockerfile.static.ubuntu (100%) diff --git a/Dockerfile.static b/Dockerfile.static.fedora similarity index 100% rename from Dockerfile.static rename to Dockerfile.static.fedora diff --git a/Dockerfile.simpler b/Dockerfile.static.ubuntu similarity index 100% rename from Dockerfile.simpler rename to Dockerfile.static.ubuntu diff --git a/README.md b/README.md index 9ca669d..fbd3b80 100644 --- a/README.md +++ b/README.md @@ -43,11 +43,11 @@ the install script will usually create the device automatically; or * manually create the device with the command `mknod /dev/fuse -m 0666 c 10 229` (see [this code](https://github.com/libfuse/libfuse/blob/f0e08cc700d629da2d46def8b620b0ed858cc0d9/util/install_helper.sh#L35)) -3. Clone this repository, and switch to the top-level folder containing the file `Dockerfile.static`; +3. Clone this repository, and switch to the top-level folder containing the file "`Dockerfile.static.ubuntu`"; 4. Launch the build with the command (note the single dot `.` at the end): ``` -buildah bud -v $PWD:/build/fuse-overlayfs -t fuse-overlayfs -f ./Dockerfile.simpler . +buildah bud -v $PWD:/build/fuse-overlayfs -t fuse-overlayfs -f ./Dockerfile.static.ubuntu . ``` 5. Copy the resulting binary to your host: