Refactor into RenderAgent and ApplyAgent
This commit is contained in:
@@ -1,16 +1,41 @@
|
||||
ARG BASE_IMAGE=localhost/monok8s/ctl-build-base:dev
|
||||
|
||||
FROM --platform=$BUILDPLATFORM ${BASE_IMAGE} AS build
|
||||
|
||||
ARG VERSION=dev
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN test -f pkg/buildinfo/buildinfo_gen.go
|
||||
|
||||
RUN mkdir -p /out && \
|
||||
GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 \
|
||||
go build -trimpath -ldflags="-s -w" \
|
||||
-o /out/ctl ./cmd/ctl
|
||||
|
||||
|
||||
FROM alpine:latest AS cacerts
|
||||
|
||||
|
||||
FROM scratch
|
||||
|
||||
ARG VERSION
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ENV VERSION=${VERSION}
|
||||
|
||||
WORKDIR /
|
||||
|
||||
COPY bin/ctl-linux-aarch64-${VERSION} ./ctl
|
||||
COPY out/fw_printenv ./
|
||||
COPY out/fw_setenv ./
|
||||
COPY --from=build /out/ctl /ctl
|
||||
COPY --from=cacerts /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
|
||||
COPY out/uboot-tools/${TARGETOS}_${TARGETARCH}/fw_printenv /fw_printenv
|
||||
COPY out/uboot-tools/${TARGETOS}_${TARGETARCH}/fw_setenv /fw_setenv
|
||||
|
||||
ENV PATH=/
|
||||
|
||||
ENTRYPOINT ["/ctl"]
|
||||
|
||||
Reference in New Issue
Block a user