stagex/packages/unixodbc/Containerfile
2024-08-26 11:24:57 -07:00

46 lines
1.2 KiB
Docker

FROM scratch AS base
ARG ARCH=x86_64
ENV VERSION=2.3.12
ENV SRC_HASH=f210501445ce21bf607ba51ef8c125e10e22dffdffec377646462df5f01915ec
ENV SRC_FILE=unixODBC-${VERSION}.tar.gz
ENV SRC_SITE=https://www.unixodbc.org/${SRC_FILE}
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
FROM fetch AS build
COPY --from=stagex/perl . /
COPY --from=stagex/bash . /
COPY --from=stagex/m4 . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/libtool . /
COPY --from=stagex/postgresql . /
RUN tar -xf $SRC_FILE
WORKDIR /unixODBC-${VERSION}
RUN --network=none <<-EOF
set -eux
./configure \
--build=${ARCH}-linux-musl \
--host=${ARCH}-linux-musl \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-nls \
--enable-gui=no \
--enable-static
make -j "$(nproc)"
EOF
FROM build AS install
RUN make DESTDIR=/rootfs install
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /