Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-binutils . /
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-ca-certificates . /
COPY --from=stagex/core-gcc . /
COPY --from=stagex/core-make . /
COPY --from=stagex/core-musl . /
COPY --from=stagex/core-go . /
ADD fetch/ssh-tpm-agent-${VERSION}.tar.gz .
WORKDIR /ssh-tpm-agent-${VERSION}
ENV GOPROXY=https://proxy.golang.org,direct
ENV GOSUMDB=sum.golang.org
ENV GOPATH=/cache/go
ENV GOBIN=${GOPATH}/bin
ENV PATH=${GOBIN}:${PATH}
RUN mkdir -p ${GOPATH}
RUN go get ./...
RUN --network=none <<-EOF
go build -o bin/ssh-tpm-agent ./cmd/ssh-tpm-agent
mkdir -p /rootfs/usr/bin/
cp bin/ssh-tpm-agent /rootfs/usr/bin/
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /