2018-07-12 23:22:19 +00:00
|
|
|
FROM golang:alpine AS build-env
|
|
|
|
|
|
|
|
# Set up dependencies
|
2020-03-18 12:43:02 +00:00
|
|
|
ENV PACKAGES git build-base
|
2018-07-12 23:22:19 +00:00
|
|
|
|
|
|
|
# Set working directory for the build
|
2022-09-07 11:44:15 +00:00
|
|
|
WORKDIR /go/src/github.com/cerc-io/laconicd
|
2018-07-12 23:22:19 +00:00
|
|
|
|
|
|
|
# Install dependencies
|
2023-03-14 05:48:42 +00:00
|
|
|
RUN apk add --no-cache $PACKAGES=~
|
2023-03-13 10:09:26 +00:00
|
|
|
|
2023-03-14 05:48:42 +00:00
|
|
|
RUN apk add --no-cache linux-headers=~
|
2018-07-12 23:22:19 +00:00
|
|
|
|
|
|
|
# Add source files
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Make the binary
|
2020-03-18 12:43:02 +00:00
|
|
|
RUN make build
|
2018-07-12 23:22:19 +00:00
|
|
|
|
|
|
|
# Final image
|
2023-01-11 15:47:50 +00:00
|
|
|
FROM alpine:3.17.1
|
2018-07-12 23:22:19 +00:00
|
|
|
|
|
|
|
# Install ca-certificates
|
2023-03-14 05:48:42 +00:00
|
|
|
RUN apk add --no-cache ca-certificates=~ jq=~ curl=~
|
2021-08-04 09:30:13 +00:00
|
|
|
WORKDIR /
|
2018-07-12 23:22:19 +00:00
|
|
|
|
2020-09-08 22:25:16 +00:00
|
|
|
# Copy over binaries from the build-env
|
2022-09-07 11:44:15 +00:00
|
|
|
COPY --from=build-env /go/src/github.com/cerc-io/laconicd/build/laconicd /usr/bin/laconicd
|
2018-07-12 23:22:19 +00:00
|
|
|
|
2022-09-07 07:26:51 +00:00
|
|
|
# Run laconicd by default
|
|
|
|
CMD ["laconicd"]
|