-
Notifications
You must be signed in to change notification settings - Fork 4
/
Containerfile.fedora
45 lines (31 loc) · 1.53 KB
/
Containerfile.fedora
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
FROM registry.fedoraproject.org/fedora:latest as macros-installer
RUN set -euo pipefail; \
# for xargs + poetry + pip
dnf -y install findutils poetry python3-pip; \
# install all packages providing a rpm macro, but filter out all packages with conflicts
# build-constraints has file level conflicts with redhat-rpm-config
dnf rq --whatprovides 'rpm_macro(*)' --qf "%{name}\n" | uniq | sed -e '/postgresql15/d' -e '/release-common/d' -e '/build-constraints/d' | xargs dnf -y install; \
# install the previously filtered out packages
dnf -y install fedora-release-common;
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; \
poetry run pytest -vv;
FROM registry.fedoraproject.org/fedora:latest
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 python3-pip; \
pip install --break-system-packages rpm_spec_language_server-${SERVER_VERSION}-py3-none-any.whl
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", "-m", "rpm_spec_language_server", "-vvv", "--ctr-mount-path=/src/", "--host=0.0.0.0"]