Build GCP guest agent from github actions in constellation repo

This commit is contained in:
Malte Poll 2022-08-09 16:33:37 +02:00 committed by Malte Poll
parent 23dfc5549b
commit abb4fb4f0f
5 changed files with 141 additions and 3 deletions

31
3rdparty/gcp-guest-agent/Dockerfile vendored Normal file
View file

@ -0,0 +1,31 @@
FROM ubuntu:22.04 as build
# Install packages
RUN apt-get update && apt-get install -y \
wget \
git
# Install Go
ARG GO_VER=1.18
RUN wget 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" ]

View file

@ -0,0 +1,41 @@
[Accounts]
deprovision_remove = /bin/false
gpasswd_add_cmd = /bin/false
gpasswd_remove_cmd = /bin/false
groupadd_cmd = /bin/false
groups = nobody
useradd_cmd = /bin/false
userdel_cmd = /bin/false
[Daemons]
accounts_daemon = false
clock_skew_daemon = false
network_daemon = true
[InstanceSetup]
host_key_types = ecdsa,ed25519,rsa
network_enabled = true
optimize_local_ssd = false
set_boto_config = false
set_host_keys = false
set_multiqueue = false
[IpForwarding]
ethernet_proto_id = 66
ip_aliases = false
target_instance_ips = true
[MetadataScripts]
default_shell = /bin/false
run_dir =
shutdown = false
startup = false
[NetworkInterfaces]
dhclient_script = /bin/false
dhcp_command = /bin/false
ip_forwarding = true
setup = false
[diagnostics]
enable = false