-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (26 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Builder
ARG BUILDER=golang:1.23-alpine3.21
ARG RUNNER=alpine:3.21
ARG CARDANO_VERSION=10.1.3
ARG CNCLI_VERSION=6.5.1
FROM ${BUILDER} AS builder
ARG CARDANO_VERSION
ARG CNCLI_VERSION
WORKDIR /workspace
COPY . .
RUN apk --no-cache add gcc musl-dev
RUN go mod download \
&& go mod verify
RUN mkdir -p bin \
&& wget https://github.com/IntersectMBO/cardano-node/releases/download/${CARDANO_VERSION}/cardano-node-${CARDANO_VERSION}-linux.tar.gz -O - | tar --strip-components=2 -xvzf - ./bin/cardano-cli -C bin \
&& wget https://github.com/cardano-community/cncli/releases/download/v${CNCLI_VERSION}/cncli-${CNCLI_VERSION}-ubuntu22-x86_64-unknown-linux-musl.tar.gz -O - | tar -xvzf - -C bin \
&& chmod +x ./bin/cncli
ENV CGO_ENABLED=1
RUN go build -v -o /usr/local/bin/cardano-validator-watcher cmd/watcher/main.go
FROM ${RUNNER}
WORKDIR /home/cardano
RUN apk --no-cache add ca-certificates curl sqlite \
&& update-ca-certificates
COPY --from=builder /usr/local/bin/cardano-validator-watcher .
COPY --from=builder /workspace/bin /usr/local/bin
ENTRYPOINT ["./cardano-validator-watcher"]