forked from cosmos/gex
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (30 loc) · 732 Bytes
/
Dockerfile
File metadata and controls
43 lines (30 loc) · 732 Bytes
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
# syntax = docker/dockerfile:1.2
# WARNING! Use `DOCKER_BUILDKIT=1` with `docker build` to enable --mount feature.
## prep the base image.
#
FROM golang:1.21.5 as base
RUN apt update && \
apt-get install -y \
build-essential \
ca-certificates \
curl
# enable faster module downloading.
ENV GOPROXY https://proxy.golang.org
## builder stage.
#
FROM base as builder
WORKDIR /
# cache dependencies.
COPY ./go.mod .
COPY ./go.sum .
RUN go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build go install -v .
## prep the final image.
#
FROM base
RUN useradd -ms /bin/bash tendermint
USER tendermint
COPY --from=builder /go/bin/gex /usr/bin
WORKDIR /apps
ENTRYPOINT ["gex"]