-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use single container for both daemonset and system extension
- Loading branch information
1 parent
2874e55
commit 6fac279
Showing
5 changed files
with
14 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
#### Build binary | ||
FROM golang:1.22.1-alpine AS builder | ||
WORKDIR /build | ||
COPY . . | ||
ARG TARGETARCH | ||
ARG CGO_ENABLED=0 | ||
ARG GOARCH=$TARGETARCH | ||
ARG GOARCH=amd64 | ||
ARG GOOS=linux | ||
RUN go test -v ./... && \ | ||
go vet ./... && \ | ||
go build -ldflags="-s -w" -trimpath -o talos-vmtoolsd ./cmd/talos-vmtoolsd | ||
|
||
#### Build system extension tree | ||
FROM alpine:3.19 AS stage | ||
RUN mkdir -p /stage/rootfs/usr/local/etc/containers | ||
RUN mkdir -p /stage/rootfs/usr/local/lib/containers/talos-vmtoolsd | ||
COPY --from=builder /build/talos-vmtoolsd /stage/rootfs/usr/local/lib/containers/talos-vmtoolsd/ | ||
COPY ./manifest.yaml /stage/ | ||
COPY ./talos-vmtoolsd.yaml /stage/rootfs/usr/local/etc/containers/ | ||
|
||
#### Build final container | ||
FROM scratch | ||
WORKDIR /bin | ||
COPY --from=builder /build/talos-vmtoolsd /bin/talos-vmtoolsd | ||
ENTRYPOINT ["/bin/talos-vmtoolsd"] | ||
COPY --from=stage /stage / | ||
ENTRYPOINT ["/rootfs/usr/local/lib/containers/talos-vmtoolsd/talos-vmtoolsd"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.