Sign inSign up

kwitsch/ziggoimg

By kwitsch

•Updated over 2 years ago

Cross compilation image for Linux GO application using ZIG as CC

Image
0

1.7K

kwitsch/ziggoimg repository overview

Cross compilation image for Linux GO application using ZIG as CC

⁠Example Dockerfile

# build stage
FROM --platform=$BUILDPLATFORM ghcr.io/kwitsch/ziggoimg AS build

# set working directory
WORKDIR /go/src

# download packages
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg \
    go mod download

# add source
COPY . .

# compile application
RUN --mount=type=bind,target=. \
    --mount=type=cache,target=/root/.cache/go-build \ 
    --mount=type=cache,target=/go/pkg \
    go build \
    -v \
    -o /bin/ctest .

# release stage
FROM scratch

# copy application
COPY --from=build /bin/ctest /app/ctest

# set entry point
ENTRYPOINT ["/bin/ctest"]

Tag summary

Content type

Image

Digest

sha256:7305bbccd…

Size

206.7 MB

Last updated

over 2 years ago

docker pull kwitsch/ziggoimg