2022-03-22 11:03:15 -04:00
|
|
|
FROM ubuntu@sha256:7cc0576c7c0ec2384de5cbf245f41567e922aab1b075f3e8ad565f508032df17 as build
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND="noninteractive"
|
2022-04-20 05:33:02 -04:00
|
|
|
RUN apt-get update && apt-get install pkg-config cmake iproute2 iputils-ping wget git jq libssl-dev libcryptsetup12 libcryptsetup-dev -y
|
2022-03-22 11:03:15 -04:00
|
|
|
|
|
|
|
# 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
|
2022-04-20 05:33:02 -04:00
|
|
|
RUN cmake .. && make coordinator
|
2022-03-22 11:03:15 -04:00
|
|
|
|
|
|
|
RUN mv coordinator coordinator-$(sha512sum coordinator | cut -d " " -f 1)
|
|
|
|
|
|
|
|
FROM scratch AS export
|
|
|
|
COPY --from=build /constellation/build/coordinator-* /
|