-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile
44 lines (30 loc) · 1 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
# Build image
FROM golang:1.20-alpine AS build-env
# Setup
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 curl nano lz4 jq
# Set working directory for the build
WORKDIR /go/src/github.com/lum-network/chain
# Add source files
COPY . .
# Display used go version
RUN go version
# Patch any issue with go mod file
RUN go mod tidy && go mod download
# Install minimum necessary dependencies, build Cosmos SDK, remove packages
RUN apk add --no-cache $PACKAGES && make install
# Final image
FROM alpine:edge
# Specify used env
ENV CHAIN /chain
# Install dependencies
RUN apk add --update ca-certificates zip python3 py3-pip curl jq lz4
RUN pip3 install pyyaml toml
RUN addgroup chain && adduser -S -G chain chain -h "$CHAIN"
# Escalate to user
USER chain
# Change the working directory to the env
WORKDIR $CHAIN
# Copy over binaries from the build-env
COPY --from=build-env /go/bin/lumd /usr/bin/lumd
# Run lumd by default, omit entrypoint to ease using container with chaincli
CMD ["lumd"]