rssmix/Containerfile
mr-boneman c86686ea8c
All checks were successful
/ build (push) Successful in 1m57s
build container on push
2024-08-20 14:44:14 +02:00

44 lines
No EOL
1.2 KiB
Docker

FROM quay.io/fedora/fedora-minimal:40 AS builder
RUN dnf5 install -y wget \
gcc glibc-devel just \
git tar xz libcurl-devel
RUN printf ". /etc/bashrc\n" > $HOME/.bashrc
ARG nimVersion=2.0.8
RUN set -euxo pipefail && \
tempdir=$(mktemp -d) && \
pushd $tempdir && \
curl -o nim.tar.xz https://nim-lang.org/download/nim-${nimVersion}-linux_x64.tar.xz && \
tar -xf nim.tar.xz && \
pushd nim-${nimVersion} && \
./install.sh /usr/bin && \
popd && \
cp nim-${nimVersion}/bin/* /usr/bin && \
mkdir ./lib && mv /usr/lib/nim/* ./lib && mv ./lib /usr/lib/nim/lib # fixes nim not finding the system lib && \
printf "export PATH=$HOME/.nimble/bin:'$PATH'" >> $HOME/.bashrc && \
popd && \
rm -fr $tempdir
WORKDIR /workdir
COPY . /workdir
ARG NIMBLESETTINGS="-d:release --opt:speed -d:strip"
RUN just build-binary '${NIMBLESETTINGS}'
FROM quay.io/fedora/fedora-minimal:40
# Add Tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
RUN dnf5 -y install libcurl && dnf5 clean all
COPY --from=builder /workdir/rssmix /bin/rssmix
STOPSIGNAL SIGINT
CMD [ "/bin/rssmix" ]