Skip to content

Commit 6443574

Browse files
committed
fix: use compiled version of cardano-tracer
1 parent c201c76 commit 6443574

File tree

2 files changed

+86
-2
lines changed

2 files changed

+86
-2
lines changed

compose/testnets/cardano_node_10.4.1/docker-compose.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,22 @@ x-base: &base
99
args:
1010
CARDANO_NODE_VERSION: "10.4.1"
1111

12+
tracer-base: &tracerbase
13+
image: ${registry}${testnet}_tracer:latest
14+
restart: on-failure
15+
build:
16+
context: "../../tracer/"
17+
dockerfile: "Dockerfile.compiled"
18+
args:
19+
CARDANO_NODE_VERSION: "10.4.1"
20+
1221
x-env: &env
1322
POOL_ID: "0" # Placeholder required for override
1423
UTXO_HD_WITH_MEM: "true"
1524

1625
services:
1726
tracer:
18-
image: ${registry}${testnet}_tracer:latest
19-
restart: on-failure
27+
<<: *tracerbase
2028
hostname: tracer.example
2129
container_name: tracer
2230
volumes:

compose/tracer/Dockerfile.compiled

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
FROM docker.io/debian:stable-slim AS build
2+
3+
ARG CARDANO_NODE_VERSION="${CARDANO_NODE_VERSION:-10.2.1}"
4+
5+
# Set time zone
6+
ENV TZ="UTC"
7+
RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && \
8+
echo ${TZ} > /etc/timezone
9+
10+
# Install packages required in build stage
11+
RUN apt update && \
12+
apt install -y --no-install-recommends \
13+
ca-certificates \
14+
curl \
15+
git \
16+
tar
17+
18+
# Create cardano-node source directory
19+
RUN install --directory --owner=root --group=root --mode=0755 /usr/local/src/cardano-node
20+
21+
# Download cardano-node archive
22+
RUN curl --proto '=https' --tlsv1.2 \
23+
--location https://github.com/IntersectMBO/cardano-node/releases/download/${CARDANO_NODE_VERSION}/cardano-node-${CARDANO_NODE_VERSION}-linux.tar.gz \
24+
--output /usr/local/src/cardano-node/cardano-node-${CARDANO_NODE_VERSION}-linux.tar.gz
25+
26+
# Create cardano-node version directory
27+
RUN install --directory --owner=root --group=root --mode=0755 /usr/local/src/cardano-node/${CARDANO_NODE_VERSION}
28+
29+
# Unarchive cardano-node tarball
30+
RUN tar --extract --gzip --file=/usr/local/src/cardano-node/cardano-node-${CARDANO_NODE_VERSION}-linux.tar.gz --directory=/usr/local/src/cardano-node/${CARDANO_NODE_VERSION}
31+
32+
# Make cardano-tracer executable
33+
RUN chmod 0755 /usr/local/src/cardano-node/${CARDANO_NODE_VERSION}/bin/cardano-tracer
34+
35+
# Create cardano-cli symlink
36+
RUN ln -s /usr/local/src/cardano-node/${CARDANO_NODE_VERSION}/bin/cardano-tracer /usr/local/bin/cardano-tracer
37+
38+
#---------------------------------------------------------------------
39+
40+
FROM docker.io/debian:stable-slim AS main
41+
42+
# Set time zone
43+
ENV TZ="UTC"
44+
RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && \
45+
echo ${TZ} > /etc/timezone
46+
47+
# Install packages required in main stage
48+
RUN apt update && \
49+
apt install -y --no-install-recommends \
50+
dnsutils \
51+
iproute2 \
52+
iputils-ping \
53+
jq \
54+
less \
55+
lsof \
56+
netbase \
57+
netcat-openbsd \
58+
openssl \
59+
procps \
60+
tcpdump \
61+
telnet \
62+
vim
63+
64+
# Copy binary from build stage
65+
COPY --from=build --chown=root:root /usr/local/bin/cardano-tracer /usr/local/bin/cardano-tracer
66+
67+
# Create cardano group and user
68+
RUN groupadd --gid 10000 cardano && \
69+
useradd --comment 'cardano' --create-home --gid 10000 --password '!' --shell '/bin/bash' --uid 10000 cardano
70+
71+
COPY tracer-config.yaml .
72+
COPY run-tracer.sh .
73+
74+
USER cardano
75+
76+
ENTRYPOINT ["/run-tracer.sh"]

0 commit comments

Comments
 (0)