-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
65 lines (52 loc) · 1.66 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# syntax=docker/dockerfile:1
ARG GO_VERSION="1.22"
# --------------------------------------------------------
# Builder
# --------------------------------------------------------
FROM golang:${GO_VERSION}-alpine3.18 as builder
ARG GIT_VERSION
ARG GIT_COMMIT
RUN apk add --no-cache \
ca-certificates \
build-base \
linux-headers
# Download go dependencies
WORKDIR /feeapp
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
go mod download
# Copy the remaining files
COPY . .
# Build feeappd binary
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="feeapp" \
-X github.com/cosmos/cosmos-sdk/version.AppName="feeappd" \
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /feeapp/bin/feeappd \
/feeapp/cmd/feeappd
# --------------------------------------------------------
# Runner
# --------------------------------------------------------
FROM alpine:3.16
COPY --from=builder /feeapp/bin/feeappd /usr/bin/feeappd
ENV HOME /.feeappd
WORKDIR $HOME
# rest server
EXPOSE 1317
# tendermint p2p
EXPOSE 26656
# tendermint rpc
EXPOSE 26657
# grpc
EXPOSE 9090
ENTRYPOINT ["feeappd"]