mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
a31c3dbbcd
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: malt3 <mp@edgeless.systems>
32 lines
839 B
Docker
32 lines
839 B
Docker
FROM ubuntu:22.04@sha256:2fdb1cf4995abb74c035e5f520c0f3a46f12b3377a59e86ecca66d8606ad64f9 as build
|
|
|
|
# Install packages
|
|
RUN apt-get update && apt-get install -y \
|
|
wget \
|
|
git
|
|
|
|
# Install Go
|
|
ARG GO_VER=1.20.4
|
|
RUN wget -q https://go.dev/dl/go${GO_VER}.linux-amd64.tar.gz && \
|
|
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 /src/
|
|
COPY go.mod ./
|
|
COPY go.sum ./
|
|
RUN go mod download all
|
|
|
|
# Build
|
|
ARG VERSION=latest
|
|
COPY . /src
|
|
WORKDIR /src/google_guest_agent
|
|
RUN CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=${VERSION}" -mod=readonly
|
|
WORKDIR /
|
|
|
|
FROM scratch as run
|
|
COPY --from=build /src/google_guest_agent/google_guest_agent /
|
|
COPY instance_configs.cfg /etc/default/
|
|
ENTRYPOINT [ "/google_guest_agent" ]
|