-
Notifications
You must be signed in to change notification settings - Fork 4
/
Containerfile.bci
49 lines (34 loc) · 1.51 KB
/
Containerfile.bci
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
ARG SLES_VERSION=15.5
FROM registry.suse.com/bci/bci-base:${SLES_VERSION} as macros-installer
ARG SLES_VERSION=15.5
ENV SLES_VERSION=${SLES_VERSION}
RUN set -euo pipefail; \
zypper -n in gawk findutils python311-pipx python311-rpm; \
# do a dumb search for -macro packages as that's the best that we can get
zypper -t se /.*-macros/ | awk -F'|' ' /package/ {print $2}' | sed '/texlive/d' | xargs zypper -n in; \
PIPX_BIN_DIR=/usr/bin pipx install poetry;
WORKDIR /build/
COPY pyproject.toml poetry.lock .
RUN set -euo pipefail; \
# need to have access to the system site packages for rpm module
poetry config virtualenvs.options.system-site-packages true; \
poetry install --no-root
COPY . .
RUN set -euo pipefail; \
poetry install --only-root; \
# FIXME: tests don't work in poetry
# poetry run pytest -vv; \
poetry build
ARG SLES_VERSION=15.5
FROM registry.suse.com/bci/bci-base:${SLES_VERSION} as runner
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; \
zypper -n in python311-pip python311-rpm; \
pip install rpm_spec_language_server-0.0.1-py3-none-any.whl;
WORKDIR /src/
EXPOSE 2087
LABEL run "podman run --rm -it -p 2087:2087 -v .:/src/:z \$IMAGE"
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"]