|
|
|
@ -46,7 +46,10 @@ ADD . .
|
|
|
|
|
COPY --from=build-xpack /opt/xpack /opt/jumpserver/apps/xpack |
|
|
|
|
|
|
|
|
|
RUN echo > /opt/jumpserver/config.yml \ |
|
|
|
|
&& cd utils && bash -ixeu build.sh |
|
|
|
|
&& \ |
|
|
|
|
if [ -n "${VERSION}" ]; then \ |
|
|
|
|
sed -i "s@VERSION = .*@VERSION = '${VERSION}'@g" apps/jumpserver/const.py; \ |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
FROM python:3.11-slim-bullseye as stage-2 |
|
|
|
|
ARG TARGETARCH |
|
|
|
@ -58,6 +61,7 @@ ARG BUILD_DEPENDENCIES=" \
|
|
|
|
|
|
|
|
|
|
ARG DEPENDENCIES=" \ |
|
|
|
|
freetds-dev \ |
|
|
|
|
gettext \ |
|
|
|
|
libffi-dev \ |
|
|
|
|
libjpeg-dev \ |
|
|
|
|
libkrb5-dev \ |
|
|
|
@ -109,6 +113,14 @@ RUN --mount=type=cache,target=/root/.cache,sharing=locked \
|
|
|
|
|
&& . /opt/py3/bin/activate \ |
|
|
|
|
&& poetry install |
|
|
|
|
|
|
|
|
|
COPY --from=stage-1 /opt/jumpserver /opt/jumpserver |
|
|
|
|
|
|
|
|
|
RUN set -ex \ |
|
|
|
|
&& export SECRET_KEY=$(head -c100 < /dev/urandom | base64 | tr -dc A-Za-z0-9 | head -c 48) \ |
|
|
|
|
&& . /opt/py3/bin/activate \ |
|
|
|
|
&& cd apps \ |
|
|
|
|
&& python manage.py compilemessages |
|
|
|
|
|
|
|
|
|
FROM python:3.11-slim-bullseye |
|
|
|
|
ARG TARGETARCH |
|
|
|
|
ENV LANG=zh_CN.UTF-8 \ |
|
|
|
@ -154,10 +166,9 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
|
|
|
&& sed -i "s@# export @export @g" ~/.bashrc \ |
|
|
|
|
&& sed -i "s@# alias @alias @g" ~/.bashrc |
|
|
|
|
|
|
|
|
|
COPY --from=stage-2 /opt/py3 /opt/py3 |
|
|
|
|
COPY --from=stage-2 /opt /opt |
|
|
|
|
COPY --from=stage-1 /usr/local/bin /usr/local/bin |
|
|
|
|
COPY --from=stage-1 /opt/jumpserver/release/jumpserver /opt/jumpserver |
|
|
|
|
COPY --from=stage-1 /opt/jumpserver/release/jumpserver/apps/libs/ansible/ansible.cfg /etc/ansible/ |
|
|
|
|
COPY --from=stage-1 /opt/jumpserver/apps/libs/ansible/ansible.cfg /etc/ansible/ |
|
|
|
|
|
|
|
|
|
WORKDIR /opt/jumpserver |
|
|
|
|
|
|
|
|
|