debian-forge-cli/Containerfile
Michael Vogt c72ed92a2f Containerfile: build without cgo to avoid arm64 crashing
This commit changes the build to not build with CGO. There is really
no need to build with CGO, we only need it for the `crypt()` version
in the images library. However since with the merge of
https://github.com/osbuild/images/pull/1114
that is no longer an issue.
2025-01-29 20:50:10 +00:00

36 lines
1.5 KiB
Docker

FROM registry.fedoraproject.org/fedora:41 AS builder
RUN dnf install -y git-core golang gpgme-devel libassuan-devel && mkdir -p /build/
ARG GOPROXY=https://proxy.golang.org,direct
RUN go env -w GOPROXY=$GOPROXY
COPY . /build
WORKDIR /build
# keep in sync with:
# https://github.com/containers/podman/blob/2981262215f563461d449b9841741339f4d9a894/Makefile#L51
# disable cgo as
# a) gcc crashes on fedora41/arm64 regularly
# b) we don't really need it
RUN CGO_ENABLED=0 go build -tags "containers_image_openpgp exclude_graphdriver_btrfs exclude_graphdriver_devicemapper" ./cmd/image-builder
FROM registry.fedoraproject.org/fedora:41
# Fast-track osbuild so we don't depend on the "slow" Fedora release process to implement new features in bib
RUN dnf install -y dnf-plugins-core \
&& dnf copr enable -y @osbuild/osbuild \
&& dnf install -y libxcrypt-compat wget osbuild osbuild-ostree osbuild-depsolve-dnf osbuild-lvm2 \
&& dnf clean all
COPY --from=builder /build/image-builder /usr/bin/
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
VOLUME /output
WORKDIR /output
# XXX: add "store" flag like bib
VOLUME /var/cache/image-builder/store
VOLUME /var/lib/containers/storage
LABEL description="This tools allows to build and deploy disk-images."
LABEL io.k8s.description="This tools allows to build and deploy disk-images."
LABEL io.k8s.display-name="Image Builder"
LABEL io.openshift.tags="base fedora40"
LABEL summary="A container to create disk-images."