0g-chain/Dockerfile

32 lines
766 B
Docker
Raw Normal View History

FROM golang:1.17-alpine AS build-env
2019-11-25 19:24:46 +00:00
# Set up dependencies
# bash, jq, curl for debugging
2019-11-25 19:24:46 +00:00
# git, make for installation
# libc-dev, gcc, linux-headers, eudev-dev are used for cgo and ledger installation
RUN apk add bash git make libc-dev gcc linux-headers eudev-dev jq curl
2019-11-25 19:24:46 +00:00
# Set working directory for the build
WORKDIR /root/kava
# default home directory is /root
# Speed up later builds by caching the dependencies
2019-11-25 19:24:46 +00:00
COPY go.mod .
COPY go.sum .
RUN go mod download
# Add source files
COPY . .
#ENV LEDGER_ENABLED False
# Mount build container cache, persisted between builder invocations
RUN --mount=type=cache,target=/root/.cache/go-build \
make install
FROM alpine:3.15
RUN apk add bash jq curl
COPY --from=build-env /go/bin/kava /bin/kava
2019-11-25 19:24:46 +00:00
CMD ["kava"]