2024-07-24 13:12:44 +00:00
|
|
|
# Fluffy
|
|
|
|
# Copyright (c) 2023-2024 Status Research & Development GmbH
|
|
|
|
# Licensed and distributed under either of
|
|
|
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
|
|
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
|
|
|
FROM debian:stable-slim AS build
|
2023-09-20 16:07:09 +00:00
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive TZ="Etc/UTC"
|
|
|
|
ENV NPROC=2
|
2023-12-11 13:56:00 +00:00
|
|
|
ENV NIMFLAGS_COMMON="-d:disableMarchNative --gcc.options.debug:'-g1' --clang.options.debug:'-gline-tables-only'"
|
2023-09-20 16:07:09 +00:00
|
|
|
|
|
|
|
RUN apt update \
|
|
|
|
&& apt install make bash build-essential git -y \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
2023-12-11 13:56:00 +00:00
|
|
|
COPY ../../ /nimbus-eth1
|
2023-09-20 16:07:09 +00:00
|
|
|
|
2023-12-11 13:56:00 +00:00
|
|
|
WORKDIR /nimbus-eth1
|
2023-09-20 16:07:09 +00:00
|
|
|
|
2023-12-11 13:56:00 +00:00
|
|
|
RUN mv vendor vendor.orig
|
2023-09-20 16:07:09 +00:00
|
|
|
|
2023-12-11 13:56:00 +00:00
|
|
|
RUN --mount=type=cache,target=/nimbus-eth1/build --mount=type=cache,target=/nimbus-eth1/vendor \
|
|
|
|
mv vendor.orig vendor && \
|
|
|
|
make -j${NPROC} NIMFLAGS="${NIMFLAGS_COMMON} --parallelBuild:${NPROC}" V=1 update
|
2023-09-20 16:07:09 +00:00
|
|
|
|
2023-12-11 13:56:00 +00:00
|
|
|
RUN --mount=type=cache,target=/nimbus-eth1/build --mount=type=cache,target=/nimbus-eth1/vendor \
|
|
|
|
make -j${NPROC} NIMFLAGS="${NIMFLAGS_COMMON} --parallelBuild:${NPROC}" fluffy && \
|
|
|
|
mv build/fluffy /usr/local/bin/fluffy
|
2023-09-20 16:07:09 +00:00
|
|
|
|
2024-07-24 13:12:44 +00:00
|
|
|
# --------------------------------- #
|
|
|
|
# Starting new image to reduce size #
|
|
|
|
# --------------------------------- #
|
|
|
|
FROM debian:stable-slim AS deploy
|
2023-09-20 16:07:09 +00:00
|
|
|
COPY --from=build /usr/local/bin/fluffy /usr/local/bin/fluffy
|
2024-07-24 13:12:44 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/local/bin/fluffy"]
|