Skip to content

Commit 85f0c3d

Browse files
Merge pull request #41 from PaskLab/development
Updated to support v9.2.x
2 parents e2c33f1 + f6345a0 commit 85f0c3d

File tree

9 files changed

+62
-122
lines changed

9 files changed

+62
-122
lines changed

Dockerfiles/build_env/aarch64/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WORKDIR /root
1313
RUN apt-get update && \
1414
apt-get install -y apt-utils git wget curl pkg-config \
1515
libgmp-dev libssl-dev libtinfo-dev libsystemd-dev liblmdb-dev \
16-
libsodium-dev zlib1g-dev llvm-14 automake make build-essential \
16+
zlib1g-dev llvm-dev automake make build-essential \
1717
libffi-dev libncursesw5 g++ jq libnuma-dev libtool autoconf
1818

1919
# Install Rust
@@ -34,7 +34,7 @@ RUN git clone https://github.com/bitcoin-core/secp256k1.git
3434

3535
WORKDIR /root/secp256k1
3636

37-
RUN git reset --hard ac83be33d0956faf6b7f61a60ab524ef7d6a473a &&\
37+
RUN git checkout v0.3.2 &&\
3838
./autogen.sh &&\
3939
./configure --enable-module-schnorrsig --enable-experimental &&\
4040
make &&\
@@ -46,7 +46,7 @@ WORKDIR /root
4646
RUN git clone https://github.com/input-output-hk/libsodium
4747

4848
WORKDIR /root/libsodium
49-
RUN git checkout dbb48cc &&\
49+
RUN git checkout dbb48cce5429cb6585c9034f002568964f1ce567 &&\
5050
./autogen.sh &&\
5151
./configure &&\
5252
make &&\
@@ -60,7 +60,7 @@ WORKDIR /root
6060
# Install BLST dependencies
6161
RUN git clone https://github.com/supranational/blst
6262
WORKDIR /root/blst
63-
RUN git checkout v0.3.10 &&\
63+
RUN git checkout v0.3.11 &&\
6464
./build.sh
6565
COPY files/libblst.pc /usr/local/lib/pkgconfig/libblst.pc
6666
RUN cp bindings/blst_aux.h bindings/blst.h bindings/blst.hpp /usr/local/include/ &&\

Dockerfiles/build_env/x86_64/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WORKDIR /root
1313
RUN apt-get update && \
1414
apt-get install -y apt-utils git wget curl pkg-config \
1515
libgmp-dev libssl-dev libtinfo-dev libsystemd-dev liblmdb-dev \
16-
libsodium-dev zlib1g-dev llvm-14 automake make build-essential \
16+
zlib1g-dev llvm-dev automake make build-essential \
1717
libffi-dev libncursesw5 g++ jq libnuma-dev libtool autoconf
1818

1919
# Install Rust

Dockerfiles/db-sync/Dockerfile

Lines changed: 36 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
1-
FROM cardano_env
1+
FROM cardano_env AS base
22

3-
LABEL name="cardano_node"
4-
LABEL description="Cardano node"
3+
LABEL name="db_sync"
4+
LABEL description="Cardano DB Sync"
55
LABEL maintainer="https://github.com/pascallapointe"
66

77
WORKDIR /root
88

99
# Install base utilities and dependencies
10-
RUN apt-get update
11-
RUN apt-get install -y libghc-postgresql-libpq-dev
12-
RUN apt-get install -y libpq5
13-
RUN apt-get install -y postgresql postgresql-contrib
10+
RUN apt-get update && \
11+
apt-get install -y libpq-dev postgresql-client
1412

15-
# Download cardano-node repository
13+
# Download Db-Sync repository
1614
ARG RELEASE
17-
ARG ARCHITECTURE
1815
ARG PGPASSFILE="config/pgpass-mainnet scripts/postgresql-setup.sh --createdb"
1916
RUN git clone https://github.com/input-output-hk/cardano-db-sync
2017
WORKDIR /root/cardano-db-sync
21-
RUN git checkout ${RELEASE}
18+
RUN git checkout ${RELEASE} && git submodule update --init --recursive
2219

23-
# Build cardano-node binary
24-
RUN cabal update
25-
RUN cabal build cardano-db-sync
26-
RUN cabal build all
20+
# Build db-sync binary
21+
RUN cabal update && \
22+
cabal user-config update && \
23+
cabal build cardano-db-sync --disable-tests && \
24+
cabal build cardano-db-tool --disable-tests
2725

2826
# Create files structure
2927
RUN mkdir -p /cardano/config /cardano/bin /cardano/ledger-state
28+
ARG ARCHITECTURE
3029
ARG RELEASE_PATH=$RELEASE
3130
ARG GHC_VERSION=ghc-9.6.4
32-
RUN cp -p dist-newstyle/build/${ARCHITECTURE}-linux/${GHC_VERSION}/cardano-db-sync-${RELEASE_PATH}/build/cardano-db-sync/cardano-db-sync /cardano/bin
33-
RUN cp -p dist-newstyle/build/${ARCHITECTURE}-linux/${GHC_VERSION}/cardano-db-tool-${RELEASE_PATH}/x/cardano-db-tool/build/cardano-db-tool/cardano-db-tool /cardano/bin
31+
RUN cp -p dist-newstyle/build/${ARCHITECTURE}-linux/${GHC_VERSION}/cardano-db-sync-${RELEASE_PATH}/build/cardano-db-sync/cardano-db-sync /cardano/bin && \
32+
cp -p dist-newstyle/build/${ARCHITECTURE}-linux/${GHC_VERSION}/cardano-db-tool-${RELEASE_PATH}/x/cardano-db-tool/build/cardano-db-tool/cardano-db-tool /cardano/bin
3433

3534
WORKDIR /root
3635
RUN mv cardano-db-sync/schema /cardano/.
@@ -39,44 +38,33 @@ RUN mv cardano-db-sync/schema /cardano/.
3938
COPY files/start.sh /cardano/scripts/start.sh
4039
COPY files/sleep.sh /cardano/scripts/sleep.sh
4140

42-
# Creating non root user cardano
43-
RUN useradd -m cardano
44-
4541
# Add permissions
46-
RUN chown -R cardano:cardano /cardano
47-
RUN chmod g+s /cardano
48-
RUN chmod 540 /cardano/scripts/*
49-
RUN chmod 540 /cardano/bin/*
50-
51-
ENV PATH=/cardano/scripts:/cardano/bin:$PATH
42+
RUN chmod g+s /cardano && \
43+
chmod 540 /cardano/scripts/* && \
44+
chmod 540 /cardano/bin/*
5245

5346
# Image clean-up
5447
WORKDIR /root
5548

5649
#RUN cabal clean
57-
RUN rm -rf cardano-db-sync
58-
RUN rm -rf .cabal .local
59-
RUN apt-get purge -y apt-utils
60-
RUN apt-get purge -y git
61-
RUN apt-get purge -y wget
62-
RUN apt-get purge -y pkg-config
63-
RUN apt-get purge -y libgmp-dev
64-
RUN apt-get purge -y libssl-dev
65-
RUN apt-get purge -y libtinfo-dev
66-
RUN apt-get purge -y libsystemd-dev
67-
RUN apt-get purge -y zlib1g-dev
68-
RUN apt-get purge -y llvm
69-
RUN apt-get purge -y build-essential
70-
RUN apt-get purge -y libffi-dev
71-
RUN apt-get purge -y make
72-
RUN apt-get purge -y g++
73-
74-
RUN apt-get autoremove -y
75-
RUN apt-get clean
76-
RUN apt-get autoclean
77-
78-
# Switch user
79-
USER cardano:cardano
50+
RUN rm -rf cardano-db-sync && \
51+
rm -rf .cabal .local && \
52+
apt-get purge -y apt-utils git wget pkg-config libgmp-dev \
53+
libssl-dev libtinfo-dev libsystemd-dev liblmdb-dev libtool \
54+
zlib1g-dev llvm-dev build-essential libffi-dev automake \
55+
make g++ libncursesw5 jq autoconf libpq-dev &&\
56+
apt-get autoremove -y && \
57+
apt-get clean && \
58+
apt-get autoclean
59+
60+
FROM ubuntu:jammy
61+
COPY --from=base / /
62+
63+
ENV PATH=/cardano/scripts:/cardano/bin:$PATH
64+
ENV CARDANO_NODE_SOCKET_PATH=/cardano/socket/node.sock
65+
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
66+
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
67+
8068
WORKDIR /cardano
8169

8270
CMD ["/bin/bash", "-c", "start.sh"]

Dockerfiles/mithril-client/Dockerfile

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,12 @@ WORKDIR /root/mithril
1717
RUN git checkout ${MITHRIL_TAG}
1818
WORKDIR /root/mithril/mithril-client-cli
1919

20-
# Support for Asahi Linux 16kb memory page, to be commented if not needed
21-
#ENV JEMALLOC_SYS_WITH_LG_PAGE=16
22-
2320
# Build mithril binary
2421
RUN make build
2522
RUN cp mithril-client /cardano/bin
2623

27-
# Creating non root user cardano
28-
# RUN useradd -m cardano
29-
3024
# Add permissions
31-
# RUN chown -R cardano:cardano /cardano
32-
RUN chmod g+s /cardano
33-
RUN chmod 540 /cardano/bin/*
25+
RUN chmod g+s /cardano && chmod 540 /cardano/bin/*
3426

3527
ENV PATH=/cardano/scripts:/cardano/bin:$PATH
3628

@@ -58,8 +50,6 @@ ENV CARDANO_NODE_SOCKET_PATH=/cardano/socket/node.sock
5850
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
5951
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
6052

61-
# Switch user
62-
# USER cardano:cardano
6353
WORKDIR /cardano
6454

6555
CMD ["/bin/bash", "-c", "tail","-f","/dev/null"]

Dockerfiles/mithril-signer/Dockerfile

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ WORKDIR /root/cardano-cli
1717
ARG GHC_VERSION=ghc-9.6.4
1818
RUN git checkout cardano-cli-${CLI_TAG} && git submodule update --init --recursive
1919

20-
# Add cabal config files
21-
RUN echo 'jobs: 4\npackage cardano-crypto-praos\n flags: +external-libsodium-vrf\n' > /root/cardano-cli/cabal.project.local
22-
23-
# Build cardano-node binary
20+
# Build cardano-cli binary
2421
RUN cabal update && cabal user-config update && cabal build cardano-cli --disable-tests
2522
RUN cp -p dist-newstyle/build/${ARCHITECTURE}-linux/${GHC_VERSION}/cardano-cli-${CLI_TAG}/x/cardano-cli/build/cardano-cli/cardano-cli /cardano/bin
2623

@@ -43,14 +40,8 @@ RUN mkdir -p /cardano/stores
4340
# Add startup scripts
4441
COPY files/start.sh /cardano/scripts/start.sh
4542

46-
# Creating non root user cardano
47-
# RUN useradd -m cardano
48-
4943
# Add permissions
50-
# RUN chown -R cardano:cardano /cardano
51-
RUN chmod g+s /cardano
52-
RUN chmod 540 /cardano/scripts/*
53-
RUN chmod 540 /cardano/bin/*
44+
RUN chmod g+s /cardano && chmod 540 /cardano/scripts/* && chmod 540 /cardano/bin/*
5445

5546
ENV PATH=/cardano/scripts:/cardano/bin:$PATH
5647
ENV CARDANO_NODE_SOCKET_PATH=/cardano/socket/node.sock
@@ -83,8 +74,6 @@ ENV CARDANO_NODE_SOCKET_PATH=/cardano/socket/node.sock
8374
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
8475
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
8576

86-
# Switch user
87-
# USER cardano:cardano
8877
WORKDIR /cardano
8978

9079
CMD ["/bin/bash", "-c", "start.sh"]

Dockerfiles/node/Dockerfile

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ RUN git clone https://github.com/IntersectMBO/cardano-node.git
1212
WORKDIR /root/cardano-node
1313
RUN git checkout ${NODE_TAG} && git submodule update --init --recursive
1414

15-
# Add cabal config files
16-
RUN echo 'jobs: 4\npackage cardano-crypto-praos\n flags: +external-libsodium-vrf\n' > /root/cardano-node/cabal.project.local
17-
1815
# Build cardano-node binary
19-
RUN cabal update && cabal user-config update && cabal build cardano-node --disable-tests
16+
RUN cabal update && cabal build cardano-node --disable-tests
2017

2118
# Create files structure
2219
ARG GHC_VERSION=ghc-9.6.4
@@ -33,11 +30,8 @@ RUN git clone https://github.com/IntersectMBO/cardano-cli.git
3330
WORKDIR /root/cardano-cli
3431
RUN git checkout cardano-cli-${CLI_TAG} && git submodule update --init --recursive
3532

36-
# Add cabal config files
37-
RUN echo 'jobs: 4\npackage cardano-crypto-praos\n flags: +external-libsodium-vrf\n' > /root/cardano-cli/cabal.project.local
38-
39-
# Build cardano-node binary
40-
RUN cabal update && cabal user-config update && cabal build cardano-cli --disable-tests
33+
# Build cardano-cli binary
34+
RUN cabal update && cabal build cardano-cli --disable-tests
4135

4236
RUN cp -p dist-newstyle/build/${ARCHITECTURE}-linux/${GHC_VERSION}/cardano-cli-${CLI_TAG}/x/cardano-cli/build/cardano-cli/cardano-cli /cardano/bin
4337

@@ -50,11 +44,7 @@ COPY files/start-with-topology.sh /cardano/scripts/start-with-topology.sh
5044
# USE CURL, DO NOT UNINSTALL CURL
5145
COPY files/topologyUpdater.sh /cardano/scripts/topologyUpdater.sh
5246

53-
# Creating non root user cardano
54-
# RUN useradd -m cardano
55-
5647
# Add permissions
57-
# RUN chown -R cardano:cardano /cardano
5848
RUN chmod g+s /cardano && chmod 540 /cardano/scripts/* && chmod 540 /cardano/bin/*
5949

6050
# Image clean-up
@@ -67,9 +57,9 @@ RUN cabal clean &&\
6757
rm -rf .cabal .local .ghcup .ghc .cache ghcup &&\
6858
rustup self uninstall -y &&\
6959
apt-get purge -y apt-utils git wget pkg-config libgmp-dev \
70-
libssl-dev libtinfo-dev libsystemd-dev liblmdb-dev libtool \
71-
zlib1g-dev llvm-14 build-essential libffi-dev automake \
72-
make g++ libncursesw5 jq autoconf &&\
60+
libssl-dev libtinfo-dev libsystemd-dev liblmdb-dev libtool \
61+
zlib1g-dev llvm-dev build-essential libffi-dev automake \
62+
make g++ libncursesw5 jq autoconf &&\
7363
apt-get autoremove -y &&\
7464
apt-get clean &&\
7565
apt-get autoclean
@@ -82,8 +72,6 @@ ENV CARDANO_NODE_SOCKET_PATH=/cardano/socket/node.sock
8272
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
8373
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
8474

85-
# Switch user
86-
# USER cardano:cardano
8775
WORKDIR /cardano
8876

8977
CMD ["/bin/bash", "-c", "start-relay.sh"]

Dockerfiles/submit/Dockerfile

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,10 @@ ARG ARCHITECTURE
1111
ARG NODE_TAG
1212
RUN git clone https://github.com/input-output-hk/cardano-node
1313
WORKDIR /root/cardano-node
14-
RUN git checkout ${NODE_TAG}
15-
RUN git submodule update --init --recursive
14+
RUN git checkout ${NODE_TAG} && git submodule update --init --recursive
1615

17-
# Add cabal config files
18-
COPY files/cabal.project.local /root/cardano-node/cabal.project.local
19-
20-
# Build cardano-node binary
21-
RUN cabal update
22-
RUN cabal user-config update
23-
RUN cabal build exe:cardano-submit-api --disable-tests
16+
# Build cardano-submit binary
17+
RUN cabal update && cabal build exe:cardano-submit-api --disable-tests
2418

2519
# Create files structure
2620
RUN mkdir -p /cardano/config /cardano/bin /cardano/db /cardano/socket /cardano/scripts
@@ -31,14 +25,8 @@ RUN cp -p dist-newstyle/build/${ARCHITECTURE}-linux/${GHC_VERSION}/cardano-submi
3125
# Add startup scripts
3226
COPY files/start.sh /cardano/scripts/start.sh
3327

34-
# Creating non root user cardano
35-
#RUN useradd -m cardano
36-
3728
# Add permissions
38-
#RUN chown -R cardano:cardano /cardano
39-
RUN chmod g+s /cardano
40-
RUN chmod 540 /cardano/scripts/*
41-
RUN chmod 540 /cardano/bin/*
29+
RUN chmod g+s /cardano && chmod 540 /cardano/scripts/* && chmod 540 /cardano/bin/*
4230

4331
ENV PATH=/cardano/scripts:/cardano/bin:$PATH
4432

@@ -51,9 +39,9 @@ RUN cabal clean &&\
5139
rm -rf .cabal .local .ghcup .ghc .cache ghcup &&\
5240
rustup self uninstall -y &&\
5341
apt-get purge -y apt-utils git wget pkg-config libgmp-dev \
54-
libssl-dev libtinfo-dev libsystemd-dev liblmdb-dev libtool \
55-
zlib1g-dev llvm-14 build-essential libffi-dev automake \
56-
make g++ libncursesw5 jq autoconf &&\
42+
libssl-dev libtinfo-dev libsystemd-dev liblmdb-dev libtool \
43+
zlib1g-dev llvm-dev build-essential libffi-dev automake \
44+
make g++ libncursesw5 jq autoconf &&\
5745
apt-get autoremove -y &&\
5846
apt-get clean &&\
5947
apt-get autoclean
@@ -66,8 +54,6 @@ ENV CARDANO_NODE_SOCKET_PATH=/cardano/socket/node.sock
6654
ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
6755
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
6856

69-
# Switch user
70-
#USER cardano:cardano
7157
WORKDIR /cardano
7258

7359
CMD ["/bin/bash", "-c", "start.sh"]

Dockerfiles/submit/files/cabal.project.local

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Docker files for setting up Cardano Node environment.
1717

1818
### Building from source
1919

20-
Since we need our binary to work on Aarch64 architecture, you'll need to build the node from the source files.
20+
Since we need our binary to work on aarch64 architecture, you'll need to build the node from the source files.
2121
I've written a Dockerfile that simplify the process.
2222

2323
First, you need to build all required images:
@@ -78,10 +78,12 @@ First, you need to build all required images:
7878
7. The DB-Sync image:
7979

8080
```bash
81+
DBSYNC_TAG=<db-sync release tag>
82+
8183
docker build \
8284
--build-arg ARCHITECTURE=${ARCHITECTURE} \
83-
--build-arg RELEASE=${VERSION_NUMBER} \
84-
-t cardano_db_sync:${VERSION_NUMBER} Dockerfiles/db-sync
85+
--build-arg RELEASE=${DBSYNC_TAG} \
86+
-t cardano_db_sync:${DBSYNC_TAG} Dockerfiles/db-sync
8587
```
8688

8789
8. Tag your image with the **latest** tag:

0 commit comments

Comments
 (0)