wip: rust/go pallets

This commit is contained in:
Lance R. Vick 2024-09-16 10:07:40 -07:00
parent 724faaeeb3
commit e2adff2416
No known key found for this signature in database
GPG key ID: 8E47A1EC35A1551D
2 changed files with 36 additions and 0 deletions

20
pallets/go/Containerfile Normal file
View file

@ -0,0 +1,20 @@
FROM stagex/filesystem
COPY --from=stagex/busybox . /
COPY --from=stagex/ca-certificates . /
COPY --from=stagex/musl . /
COPY --from=stagex/go . /
ENV GOPATH=/home/user/go
ENV GOCACHE=/home/user/go/cache/
ENV GOPROXY=https://proxy.golang.org,direct
ENV GOSUMDB=sum.golang.org
ENV GOWORK=off
ENV GOHOSTOS=linux
ENV GOHOSTARCH=amd64
ENV CGO_ENABLED=0
ENV GO_LDFLAGS="-s -w -buildid= -extldflags=-static"
ENV GO_BUILDFLAGS="-x -v -trimpath -buildvcs=false"
ENV GOFLAGS=${GO_BUILDFLAGS} -ldflags="${GO_LDFLAGS}"
ENTRYPOINT ["/usr/bin/go"]
CMD ["version"]

View file

@ -0,0 +1,16 @@
FROM stagex/filesystem
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/llvm . /
COPY --from=stagex/libunwind . /
COPY --from=stagex/zlib . /
COPY --from=stagex/rust . /
ENV RUSTFLAGS='-C target-feature=+crt-static'
ENV CARGOFLAGS='--target x86_64-unknown-linux-musl --no-default-features --locked --release'
ENV CARGO_HOME=/home/user/cargo
ENTRYPOINT ["/usr/bin/rustc"]
CMD ["--version"]