Skip to content

Commit

Permalink
Fixed builds #2213
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Dec 22, 2023
1 parent ebc9e23 commit 7529553
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 40 deletions.
30 changes: 10 additions & 20 deletions tools/uidmap/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#syntax=docker/dockerfile:1.6.0

FROM ubuntu:22.04@sha256:6042500cf4b44023ea1894effe7890666b0c5c7871ed83a97c36c76ae560bb9b AS build
FROM nicholasdille/ubuntu:22.04 AS prepare
COPY --from=ghcr.io/uniget-org/tools/uniget-build:latest \
/etc/profile.d/ \
/etc/profile.d/
SHELL [ "bash", "-clo", "errexit" ]
RUN <<EOF
apt-get update
apt-get -y install --no-install-recommends \
Expand All @@ -15,26 +19,12 @@ ARG version
RUN <<EOF
curl -sL https://github.com/shadow-maint/shadow/releases/download/v${version}/shadow-${version}.tar.xz \
| tar -xJ --strip-components 1
./configure --prefix=/opt/uidmap --enable-static --disable-shared
./configure --prefix="${prefix}" --enable-static --disable-shared
make LDFLAGS=--static
mkdir -p \
/opt/uidmap/bin \
/opt/uidmap/share/man/man1
cp src/newuidmap /opt/uidmap/bin
cp src/newgidmap /opt/uidmap/bin
cp man/man1/newuidmap.1 /opt/uidmap/share/man/man1
cp man/man1/newgidmap.1 /opt/uidmap/share/man/man1
EOF

FROM nicholasdille/ubuntu:22.04 AS prepare
COPY --from=ghcr.io/uniget-org/tools/uniget-build:latest \
/etc/profile.d/ \
/etc/profile.d/
SHELL [ "bash", "-clo", "errexit" ]
ARG name
ARG version
COPY --from=build /opt/uidmap/ ${prefix}/
RUN <<EOF
cp src/newuidmap "${prefix}/bin"
cp src/newgidmap "${prefix}/bin"
cp man/man1/newuidmap.1 "${prefix}/share/man/man1"
cp man/man1/newgidmap.1 "${prefix}/share/man/man1"
chmod u+s "${prefix}/bin/newuidmap"
chmod u+s "${prefix}/bin/newgidmap"
EOF
30 changes: 10 additions & 20 deletions tools/util-linux/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#syntax=docker/dockerfile:1.6.0

FROM ubuntu:22.04@sha256:6042500cf4b44023ea1894effe7890666b0c5c7871ed83a97c36c76ae560bb9b AS build
FROM nicholasdille/ubuntu:22.04 AS prepare
COPY --from=ghcr.io/uniget-org/tools/uniget-build:latest \
/etc/profile.d/ \
/etc/profile.d/
SHELL [ "bash", "-clo", "errexit" ]
RUN <<EOF
apt-get update
apt-get -y install --no-install-recommends \
Expand All @@ -25,26 +29,12 @@ git clone -q --config advice.detachedHead=false --depth 1 --branch "v${version}"
./autogen.sh
./configure --disable-shared
make LDFLAGS=--static
mkdir -p \
/opt/util-linux/bin \
/opt/util-linux/share/man/man1 \
/opt/util-linux/share/man/man8 \
/opt/util-linux/share/bash-completion/completions
cp lsns nsenter unshare /opt/util-linux/bin
cp lsns nsenter unshare "${prefix}/bin"
cp \
sys-utils/nsenter.1 sys-utils/unshare.1 \
/opt/util-linux/share/man/man1/
cp sys-utils/lsns.8 /opt/util-linux/share/man/man8/
"${prefix}/share/man/man1/"
cp sys-utils/lsns.8 "${prefix}/share/man/man8/"
cp \
bash-completion/lsns bash-completion/nsenter bash-completion/unshare \
/opt/util-linux/share/bash-completion/completions
EOF

FROM nicholasdille/ubuntu:22.04 AS prepare
COPY --from=ghcr.io/uniget-org/tools/uniget-build:latest \
/etc/profile.d/ \
/etc/profile.d/
SHELL [ "bash", "-clo", "errexit" ]
ARG name
ARG version
COPY --from=build /opt/util-linux/ ${prefix}/
"${prefix}/share/bash-completion/completions"
EOF

0 comments on commit 7529553

Please sign in to comment.