forked from piplabs/story
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (26 loc) · 984 Bytes
/
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
# Support setting various labels on the final image
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""
# Build Geth in a stock Go builder container
FROM golang:1.22-alpine as builder
# Set the Current Working Directory inside the container
WORKDIR /story
# Copy go.mod and go.sum files
COPY go.mod go.sum ./
# Download all dependencies. Dependencies are cached if the go.mod and go.sum files are not changed
RUN go mod download
ADD . /story/
RUN go build -o story ./client
# Pull Geth into a second stage deploy alpine container
FROM alpine:latest
RUN apk add --no-cache ca-certificates
COPY --from=builder /story/story /usr/local/bin/
EXPOSE 1317 26656 26657 26660
WORKDIR /root/.story/story
ENTRYPOINT ["/bin/sh", "-c", "story init --network $NETWORK && exec story run \"$@\"", "--"]
# Add some metadata labels to help programmatic image consumption
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""
LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM" network="$NETWORK"