Skip to content

Commit 2637dc1

Browse files
authored
Merge pull request #16 from cloudstruct/chore/better-docker-cache
chore: improve docker cache usage
2 parents bc282d2 + a8038fa commit 2637dc1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM debian:stable-slim as builder
22
ARG CABAL_VERSION=3.6.2.0
33
ARG GHC_VERSION=8.10.7
4-
ARG NODE_VERSION=1.35.3
54

65
WORKDIR /code
76

@@ -69,7 +68,9 @@ RUN git clone https://github.com/bitcoin-core/secp256k1 && \
6968
make && \
7069
make install
7170

71+
FROM builder as cardano-node-build
7272
# Install cardano-node
73+
ARG NODE_VERSION=1.35.3
7374
ENV NODE_VERSION=${NODE_VERSION}
7475
RUN echo "Building tags/${NODE_VERSION}..." \
7576
&& echo tags/${NODE_VERSION} > /CARDANO_BRANCH \
@@ -93,9 +94,9 @@ RUN echo "Building tags/${NODE_VERSION}..." \
9394
FROM debian:stable-slim as cardano-node
9495
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
9596
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
96-
COPY --from=builder /usr/local/lib/ /usr/local/lib/
97-
COPY --from=builder /usr/local/include/ /usr/local/include/
98-
COPY --from=builder /root/.local/bin/cardano-* /usr/local/bin/
97+
COPY --from=cardano-node-build /usr/local/lib/ /usr/local/lib/
98+
COPY --from=cardano-node-build /usr/local/include/ /usr/local/include/
99+
COPY --from=cardano-node-build /root/.local/bin/cardano-* /usr/local/bin/
99100
COPY bin/ /usr/local/bin/
100101
COPY config/ /opt/cardano/config/
101102
RUN apt-get update -y && \

0 commit comments

Comments
 (0)