cloud-image-uploader/Containerfile
Jeremy Cline e16b83df7f
Some checks failed
/ test (push) Failing after 24s
Update container to Fedora 44, use mostly distro packages
Recently there was a regression in Pika, and it would generally be nice
to use distribution packages for most of our dependencies. Since the
image tester is already committing similar crimes I think it's fine for
the uploader, too.

Right now we only pull in the Google SDK bits from PyPI, as well as the
Azure compute module from there since the Azure CLI pins an ancient
version.

Signed-off-by: Jeremy Cline <jeremycline@microsoft.com>
2026-08-06 13:32:05 -04:00

50 lines
1.8 KiB
Docker

FROM quay.io/fedora/fedora:44 as builder
RUN dnf install -y \
python3-pip \
python3-hatchling
RUN mkdir -p /srv/{src,dist}/
COPY . /srv/src
RUN cd /srv/src/fedora-image-uploader && hatchling build -d /srv/dist/ --target=wheel
RUN cd /srv/src/fedora-image-uploader-messages && hatchling build -d /srv/dist/ --target=wheel
FROM quay.io/fedora/fedora:44
LABEL org.opencontainers.image.authors="Fedora Cloud SIG <cloud@lists.fedoraproject.org>"
RUN mkdir -p /srv/fedora-image-uploader
WORKDIR /srv/fedora-image-uploader
COPY --from=builder /srv/dist /srv/dist
# Use the system-provided libraries as much as we can here.
#
# We do need to commit a small crime so the system-provided fedora-messaging
# library uses our virtualenv
RUN dnf install -y \
fedora-messaging \
python3-azure-identity \
python3-azure-storage-blob \
python3-boto3 \
python3-botocore \
python3-fedfind \
python3-fedora-image-uploader-messages \
python3-pip \
python3-requests \
python3-setuptools \
skopeo
RUN python3 -m venv --system-site-packages venv && \
venv/bin/pip install --no-cache-dir /srv/dist/fedora_image_uploader_messages-*.whl && \
venv/bin/pip install --no-cache-dir /srv/dist/fedora_image_uploader-0.4.0-py3-none-any.whl[aws,azure,gcp]
RUN cp /usr/bin/fedora-messaging /srv/fedora-image-uploader/venv/bin/fedora-messaging && \
sed -i 's|/usr/bin/python3|/srv/fedora-image-uploader/venv/bin/python3|g' \
/srv/fedora-image-uploader/venv/bin/fedora-messaging
# Add the virtual environment to the path for convenience when in a debug container
ENV PATH="/srv/fedora-image-uploader/venv/bin:$PATH"
ENV VIRTUAL_ENV="/srv/fedora-image-uploader/venv"
ENTRYPOINT ["/srv/fedora-image-uploader/venv/bin/fedora-messaging"]
CMD ["consume", "--callback=fedora_image_uploader:Uploader"]