constellation/Dockerfile.build

30 lines
886 B
Docker
Raw Normal View History

FROM ubuntu@sha256:7cc0576c7c0ec2384de5cbf245f41567e922aab1b075f3e8ad565f508032df17 as build
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && apt-get install pkg-config cmake iproute2 iputils-ping wget git jq libssl-dev libcryptsetup12 libcryptsetup-dev -y
# Install Go
ARG GO_VER=1.18
RUN wget https://go.dev/dl/go${GO_VER}.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go${GO_VER}.linux-amd64.tar.gz && rm go${GO_VER}.linux-amd64.tar.gz
ENV PATH ${PATH}:/usr/local/go/bin
# Download go dependencies
WORKDIR /constellation/
COPY go.mod ./
COPY go.sum ./
RUN go mod download all
# Copy Repo
COPY . /constellation
# Build
RUN mkdir -p /constellation/build
WORKDIR /constellation/build
RUN cmake .. && make coordinator
RUN mv coordinator coordinator-$(sha512sum coordinator | cut -d " " -f 1)
FROM scratch AS export
COPY --from=build /constellation/build/coordinator-* /