Kubernetes Web View to list and view all Kubernetes resources https://kube-web-view.readthedocs.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.0 KiB

FROM python:3.10
RUN pip3 install poetry
COPY poetry.lock /
COPY pyproject.toml /
# fake package to make Poetry happy (we will install the actual contents in the later stage)
RUN mkdir /kube_web && touch /kube_web/__init__.py && touch /README.md
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-dev --no-ansi
FROM python:3.10-slim
# copy pre-built packages to this image
COPY --from=0 /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
# now copy the actual code we will execute (poetry install above was just for dependencies)
COPY kube_web /kube_web
# replace build version in package and
# add build version to static asset links to break browser cache
# see also "version" in Makefile
RUN sed -i "s/^__version__ = .*/__version__ = \"${VERSION}\"/" /kube_web/__init__.py && \
sed -i "s/v=[0-9A-Za-z._-]*/v=${VERSION}/g" /kube_web/templates/base.html
ENTRYPOINT ["/usr/local/bin/python", "-m", "kube_web"]