Skip to content

Commit 3eb8d5b

Browse files
committed
chore: add ARG USE_IOG_BINARY_CACHE=
1 parent f505704 commit 3eb8d5b

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ARG TARGETARCH=amd64
33
ARG CARDANO_NODE_VERSION=1.35.7
44
ARG CARDANO_DB_SYNC_VERSION=13.1.0.0
55
ARG NODEJS_MAJOR_VERSION=14
6+
ARG USE_IOG_BINARY_CACHE=
67

78
FROM ${TARGETARCH}/ubuntu:${UBUNTU_VERSION} as haskell-builder
89
ARG TARGETARCH
@@ -12,12 +13,16 @@ ENV DEBIAN_FRONTEND=noninteractive
1213
RUN apt update -y
1314
RUN apt install curl git -y
1415
# Note: `sandbox = false` is for compatibility with Podman, Docker doesn’t require it.
15-
# Note: you can comment out `substituters` to build the world from source (including multiple GHC stages).
1616
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/tag/v0.11.0 | sh -s -- install linux \
1717
--extra-conf "sandbox = false" \
18-
--extra-conf "substituters = https://cache.nixos.org https://cache.iog.io" \
19-
--extra-conf "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" \
2018
--init none --no-confirm
19+
# Note: if you don’t set USE_IOG_BINARY_CACHE=1, you will be rebuilding our Haskell world from source (including multiple GHC stages).
20+
ARG USE_IOG_BINARY_CACHE
21+
RUN \
22+
if [ -n "${USE_IOG_BINARY_CACHE}" ] ; then \
23+
echo "substituters = https://cache.nixos.org https://cache.iog.io" >>/etc/nix/nix.conf &&\
24+
echo "trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" >>/etc/nix/nix.conf ;\
25+
fi
2126
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
2227
# We don’t officially support AArch64, so we have to go through some hops:
2328
SHELL ["/bin/bash", "-c"]

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Build [from anywhere], _optionally_ specifying a [network] name other than `main
1010
build argument, and accessing cached build layers to reduce the initialization time. You can also
1111
build with local source by replacing the GitHub link with `.`
1212

13+
Note: if you don’t specify `--build-arg USE_IOG_BINARY_CACHE=1`, you will actually be rebuilding our Haskell world from source (including several stages of the Glasgow Haskell Compiler). It’s bound to take a lot of time.
14+
1315
### Supported Architectures
1416
- `linux/amd64`
1517
- `linux/arm64`
@@ -21,6 +23,7 @@ build with local source by replacing the GitHub link with `.`
2123
DOCKER_BUILDKIT=1 \
2224
docker build \
2325
--build-arg BUILDKIT_INLINE_CACHE=1 \
26+
--build-arg USE_IOG_BINARY_CACHE=1 \
2427
--cache-from=inputoutput/cardano-rosetta:master \
2528
-t inputoutput/cardano-rosetta:2.1.0 \
2629
https://github.com/input-output-hk/cardano-rosetta.git#2.1.0
@@ -35,6 +38,7 @@ docker build \
3538
DOCKER_BUILDKIT=1 \
3639
docker build \
3740
--build-arg BUILDKIT_INLINE_CACHE=1 \
41+
--build-arg USE_IOG_BINARY_CACHE=1 \
3842
--build-arg NETWORK=preprod \
3943
--cache-from=inputoutput/cardano-rosetta:master \
4044
-t inputoutput/cardano-rosetta:2.1.0-preprod \
@@ -50,6 +54,7 @@ docker build \
5054
DOCKER_BUILDKIT=1 \
5155
docker build \
5256
--build-arg BUILDKIT_INLINE_CACHE=1 \
57+
--build-arg USE_IOG_BINARY_CACHE=1 \
5358
--build-arg NETWORK=preview \
5459
--cache-from=inputoutput/cardano-rosetta:master \
5560
-t inputoutput/cardano-rosetta:2.1.0-preview \
@@ -154,6 +159,7 @@ For example:
154159
DOCKER_BUILDKIT=1 \
155160
docker build \
156161
--build-arg BUILDKIT_INLINE_CACHE=1 \
162+
--build-arg USE_IOG_BINARY_CACHE=1 \
157163
--build-arg SNAPSHOT_URL=https://update-cardano-mainnet.iohk.io/cardano-db-sync/13/db-sync-snapshot-schema-13-block-7960123-x86_64.tgz \
158164
--cache-from=inputoutput/cardano-rosetta:master \
159165
-t inputoutput/cardano-rosetta:2.1.0-apply-snapshot \

0 commit comments

Comments
 (0)