2024-07-10 14:36:09 +00:00
|
|
|
FROM golang:1.21-bullseye AS builder
|
2024-03-07 05:10:41 +00:00
|
|
|
|
|
|
|
# Set working directory for the build
|
2024-04-01 09:57:26 +00:00
|
|
|
WORKDIR /go/src/git.vdb.to/cerc-io/laconicd
|
2024-03-07 05:10:41 +00:00
|
|
|
|
|
|
|
# Cache Go modules
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
# Add source files
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Make the binary
|
|
|
|
RUN make build
|
|
|
|
|
|
|
|
# Final image
|
2024-07-10 14:36:09 +00:00
|
|
|
FROM ubuntu:22.04
|
2024-03-07 05:10:41 +00:00
|
|
|
|
2024-07-10 14:36:09 +00:00
|
|
|
# Install ca-certificates, jq, curl, bash, and other necessary packages
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
ca-certificates \
|
2024-10-17 06:10:33 +00:00
|
|
|
jq curl netcat bash bc \
|
2024-07-10 14:36:09 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2024-03-07 05:10:41 +00:00
|
|
|
|
2024-07-10 14:36:09 +00:00
|
|
|
# Copy over binary from the builder
|
|
|
|
COPY --from=builder /go/src/git.vdb.to/cerc-io/laconicd/build/laconicd /usr/bin/laconicd
|
2024-03-07 05:10:41 +00:00
|
|
|
|
2024-08-01 11:52:47 +00:00
|
|
|
# Copy over init script from builder
|
|
|
|
COPY --from=builder /go/src/git.vdb.to/cerc-io/laconicd/scripts/init.sh scripts/init.sh
|
|
|
|
|
2024-03-07 05:10:41 +00:00
|
|
|
WORKDIR /
|
|
|
|
|
2024-04-01 09:57:26 +00:00
|
|
|
# Run laconicd by default
|
|
|
|
CMD ["laconicd"]
|