Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
guoshijiang authored Sep 27, 2024
1 parent 8b37a01 commit a0feca9
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# Build wallet-chain-node in a stock Go builder container
FROM golang:1.19.3-alpine as builder
FROM golang:1.21.1-alpine3.18 as builder

RUN apk add --no-cache make gcc musl-dev linux-headers
RUN apk add --no-cache make ca-certificates gcc musl-dev linux-headers git jq bash

ADD . /wallet-chain-node
RUN cd /wallet-chain-node && go build
COPY ./go.mod /app/go.mod
COPY ./go.sum /app/go.sum

# Pull wallet-chain-node into a second stage deploy alpine container
FROM alpine:latest
WORKDIR /app

RUN apk add --no-cache ca-certificates
RUN mkdir /etc/wallet-chain-node
RUN go mod download

ARG CONFIG=config.yml
# build wallet-chain-node with the shared go.mod & go.sum files
COPY . /app/wallet-chain-node

COPY --from=builder /wallet-chain-node /usr/local/bin/
COPY --from=builder /wallet-chain-node/${CONFIG} /etc/wallet-chain-node/config.yml
WORKDIR /app/wallet-chain-node

RUN make

FROM alpine:3.18

COPY --from=builder /app/wallet-chain-node/wallet-chain-node /usr/local/bin
COPY --from=builder /app/wallet-chain-node/config.yaml /app/wallet-chain-node/config.yaml

EXPOSE 8189
ENTRYPOINT ["wallet-chain-node"]
CMD ["-c", "/etc/wallet-chain-node/config.yml"]

0 comments on commit a0feca9

Please sign in to comment.