File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 11FROM alpine:latest AS build
2- ARG UTIL_LINUX_VERSION=2.41
32WORKDIR /usr/src
43
54# build dependencies
65RUN apk update && apk add build-base linux-headers autoconf gettext-dev automake flex bison libtool git
76
8- ENV UTIL_LINUX_VERSION=${UTIL_LINUX_VERSION}
9- RUN git clone https://github.com/util-linux/util-linux.git --branch v$UTIL_LINUX_VERSION
10- WORKDIR /usr/src/util-linux
7+ ARG REPO=https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
8+
9+ RUN E2FS_LATEST_VER=$(git -c 'versionsort.suffix=-' \
10+ ls-remote --exit-code --refs --sort='version:refname' --tags $REPO '*.*.*' \
11+ | tail -n 1 \
12+ | cut -d '/' -f 3) && \
13+ git clone https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git --branch $E2FS_LATEST_VER
14+
1115ENV CFLAGS="-O2 -Wall -static"
1216ENV LDFLAGS="--static"
13- RUN ./autogen.sh && ./configure --disable-all-programs --enable-mkfs && make -j`nproc` mkfs
17+ WORKDIR /usr/src/e2fsprogs
18+ RUN mkdir build
19+ RUN cd build && ../configure && make -j`nproc`
1420
1521FROM scratch AS final
16- COPY --from=build /usr/src/util-linux/mkfs /mkfs
22+ COPY --from=build /usr/src/e2fsprogs/build/misc/mke2fs /mkfs.ext4
You can’t perform that action at this time.
0 commit comments