-
Notifications
You must be signed in to change notification settings - Fork 4
/
Containerfile.leap
57 lines (43 loc) · 1.94 KB
/
Containerfile.leap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
ARG LEAP_VERSION=15.5
FROM registry.opensuse.org/opensuse/leap-dnf:${LEAP_VERSION} AS macros-installer
ARG LEAP_VERSION=15.5
ENV LEAP_VERSION=${LEAP_VERSION}
RUN set -euo pipefail; \
# for xargs + poetry + pip
dnf -y install findutils python311-pip; \
# whatprovides 'rpm_macro(*)' doesn't work on Leap, so just do a dumb search for *-macros
if [ "${LEAP_VERSION}" = "15.5" ]; then \
dnf rq --whatprovides '*macros' --qf "%{name}" | uniq | sed '/pyqt/d' | xargs dnf install -y; \
# install the previously filtered out packages
dnf -y install python3-pyqt-rpm-macros; \
elif [ "${LEAP_VERSION}" = "15.6" ]; then \
dnf rq --whatprovides '*macros' --qf "%{name}" | uniq | sed '/mariadb104/d' | xargs dnf install -y; \
else exit 1; fi; \
pip install poetry;
WORKDIR /build/
COPY pyproject.toml poetry.lock .
RUN poetry install --no-root
COPY . .
ENV TEST_SLEEP_TIMEOUT=2
RUN set -euo pipefail; \
poetry install --only-root; \
poetry build; # \
# FIXME: tests don't work from poetry
# poetry run pytest -vv
ARG LEAP_VERSION=15.5
FROM registry.opensuse.org/opensuse/leap-dnf:${LEAP_VERSION}
ARG SERVER_VERSION=0.0.1
COPY --from=macros-installer /build/dist/rpm_spec_language_server-${SERVER_VERSION}-py3-none-any.whl .
COPY --from=macros-installer /usr/lib/rpm/ /usr/lib/rpm
RUN set -euo pipefail; \
dnf -y install python311-pip; \
pip install rpm_spec_language_server-${SERVER_VERSION}-py3-none-any.whl; \
# HACK: the rpm shim doesn't work on Leap so just use the system package
pip uninstall --yes rpm; \
dnf -y install python311-rpm;
WORKDIR /src/
EXPOSE 2087
LABEL run "podman run --rm -it -p 2087:2087 -v .:/src/:z \$IMAGE"
LABEL org.opencontainers.image.source="https://github.com/dcermak/rpm-spec-language-server/"
MAINTAINER Dan Čermák <[email protected]>
ENTRYPOINT ["/usr/bin/python3.11", "-m", "rpm_spec_language_server", "-vvv", "--ctr-mount-path=/src/", "--host=0.0.0.0"]