|
|
@ -23,6 +23,14 @@ RUN set -ex \
|
|
|
|
&& chmod 755 /usr/local/bin/check \
|
|
|
|
&& chmod 755 /usr/local/bin/check \
|
|
|
|
&& rm -f check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz
|
|
|
|
&& rm -f check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ARG RECEPTOR_VERSION=v1.4.5
|
|
|
|
|
|
|
|
RUN set -ex \
|
|
|
|
|
|
|
|
&& wget -O /opt/receptor.tar.gz https://github.com/ansible/receptor/releases/download/${RECEPTOR_VERSION}/receptor_${RECEPTOR_VERSION/v/}_linux_${TARGETARCH}.tar.gz \
|
|
|
|
|
|
|
|
&& tar -xf /opt/receptor.tar.gz -C /usr/local/bin/ \
|
|
|
|
|
|
|
|
&& chown root:root /usr/local/bin/receptor \
|
|
|
|
|
|
|
|
&& chmod 755 /usr/local/bin/receptor \
|
|
|
|
|
|
|
|
&& rm -f /opt/receptor.tar.gz
|
|
|
|
|
|
|
|
|
|
|
|
ARG VERSION
|
|
|
|
ARG VERSION
|
|
|
|
ENV VERSION=$VERSION
|
|
|
|
ENV VERSION=$VERSION
|
|
|
|
|
|
|
|
|
|
|
@ -36,6 +44,7 @@ ARG TARGETARCH
|
|
|
|
|
|
|
|
|
|
|
|
ARG BUILD_DEPENDENCIES=" \
|
|
|
|
ARG BUILD_DEPENDENCIES=" \
|
|
|
|
g++ \
|
|
|
|
g++ \
|
|
|
|
|
|
|
|
make \
|
|
|
|
pkg-config"
|
|
|
|
pkg-config"
|
|
|
|
|
|
|
|
|
|
|
|
ARG DEPENDENCIES=" \
|
|
|
|
ARG DEPENDENCIES=" \
|
|
|
@ -58,27 +67,28 @@ ARG TOOLS=" \
|
|
|
|
curl \
|
|
|
|
curl \
|
|
|
|
default-libmysqlclient-dev \
|
|
|
|
default-libmysqlclient-dev \
|
|
|
|
default-mysql-client \
|
|
|
|
default-mysql-client \
|
|
|
|
libldap2-dev \
|
|
|
|
git \
|
|
|
|
libsasl2-dev \
|
|
|
|
git-lfs \
|
|
|
|
libxml2-dev \
|
|
|
|
unzip \
|
|
|
|
libxmlsec1-dev \
|
|
|
|
xz-utils \
|
|
|
|
libxmlsec1-openssl"
|
|
|
|
wget"
|
|
|
|
|
|
|
|
|
|
|
|
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
|
|
|
|
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
|
|
|
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core-apt \
|
|
|
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \
|
|
|
|
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=core-apt \
|
|
|
|
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=core \
|
|
|
|
sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
|
|
|
|
sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
|
|
|
|
&& rm -f /etc/apt/apt.conf.d/docker-clean \
|
|
|
|
&& rm -f /etc/apt/apt.conf.d/docker-clean \
|
|
|
|
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
|
|
|
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get -y install --no-install-recommends ${BUILD_DEPENDENCIES} \
|
|
|
|
&& apt-get -y install --no-install-recommends ${BUILD_DEPENDENCIES} \
|
|
|
|
&& apt-get -y install --no-install-recommends ${DEPENDENCIES} \
|
|
|
|
&& apt-get -y install --no-install-recommends ${DEPENDENCIES} \
|
|
|
|
|
|
|
|
&& apt-get -y install --no-install-recommends ${TOOLS} \
|
|
|
|
&& echo "no" | dpkg-reconfigure dash
|
|
|
|
&& echo "no" | dpkg-reconfigure dash
|
|
|
|
|
|
|
|
|
|
|
|
WORKDIR /opt/jumpserver
|
|
|
|
WORKDIR /opt/jumpserver
|
|
|
|
|
|
|
|
|
|
|
|
ARG PIP_MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple
|
|
|
|
ARG PIP_MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple
|
|
|
|
RUN --mount=type=cache,target=/root/.cache \
|
|
|
|
RUN --mount=type=cache,target=/root/.cache,sharing=locked,id=core \
|
|
|
|
--mount=type=bind,source=poetry.lock,target=/opt/jumpserver/poetry.lock \
|
|
|
|
--mount=type=bind,source=poetry.lock,target=/opt/jumpserver/poetry.lock \
|
|
|
|
--mount=type=bind,source=pyproject.toml,target=/opt/jumpserver/pyproject.toml \
|
|
|
|
--mount=type=bind,source=pyproject.toml,target=/opt/jumpserver/pyproject.toml \
|
|
|
|
set -ex \
|
|
|
|
set -ex \
|
|
|
@ -94,7 +104,6 @@ ENV LANG=en_US.UTF-8 \
|
|
|
|
PATH=/opt/py3/bin:$PATH
|
|
|
|
PATH=/opt/py3/bin:$PATH
|
|
|
|
|
|
|
|
|
|
|
|
ARG DEPENDENCIES=" \
|
|
|
|
ARG DEPENDENCIES=" \
|
|
|
|
libjpeg-dev \
|
|
|
|
|
|
|
|
libldap2-dev \
|
|
|
|
libldap2-dev \
|
|
|
|
libpq-dev \
|
|
|
|
libpq-dev \
|
|
|
|
libx11-dev \
|
|
|
|
libx11-dev \
|
|
|
@ -103,17 +112,12 @@ ARG DEPENDENCIES=" \
|
|
|
|
ARG TOOLS=" \
|
|
|
|
ARG TOOLS=" \
|
|
|
|
ca-certificates \
|
|
|
|
ca-certificates \
|
|
|
|
default-libmysqlclient-dev \
|
|
|
|
default-libmysqlclient-dev \
|
|
|
|
default-mysql-client \
|
|
|
|
|
|
|
|
iputils-ping \
|
|
|
|
|
|
|
|
locales \
|
|
|
|
|
|
|
|
netcat-openbsd \
|
|
|
|
|
|
|
|
nmap \
|
|
|
|
|
|
|
|
openssh-client \
|
|
|
|
openssh-client \
|
|
|
|
sshpass"
|
|
|
|
sshpass"
|
|
|
|
|
|
|
|
|
|
|
|
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
|
|
|
|
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
|
|
|
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core-apt \
|
|
|
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \
|
|
|
|
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=core-apt \
|
|
|
|
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=core \
|
|
|
|
sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
|
|
|
|
sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
|
|
|
|
&& rm -f /etc/apt/apt.conf.d/docker-clean \
|
|
|
|
&& rm -f /etc/apt/apt.conf.d/docker-clean \
|
|
|
|
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
|
|
|
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
|
|
@ -126,14 +130,6 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core-apt \
|
|
|
|
&& sed -i "s@# export @export @g" ~/.bashrc \
|
|
|
|
&& sed -i "s@# export @export @g" ~/.bashrc \
|
|
|
|
&& sed -i "s@# alias @alias @g" ~/.bashrc
|
|
|
|
&& sed -i "s@# alias @alias @g" ~/.bashrc
|
|
|
|
|
|
|
|
|
|
|
|
ARG RECEPTOR_VERSION=v1.4.5
|
|
|
|
|
|
|
|
RUN set -ex \
|
|
|
|
|
|
|
|
&& wget -O /opt/receptor.tar.gz https://github.com/ansible/receptor/releases/download/${RECEPTOR_VERSION}/receptor_${RECEPTOR_VERSION/v/}_linux_${TARGETARCH}.tar.gz \
|
|
|
|
|
|
|
|
&& tar -xf /opt/receptor.tar.gz -C /usr/local/bin/ \
|
|
|
|
|
|
|
|
&& chown root:root /usr/local/bin/receptor \
|
|
|
|
|
|
|
|
&& chmod 755 /usr/local/bin/receptor \
|
|
|
|
|
|
|
|
&& rm -f /opt/receptor.tar.gz
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY --from=stage-2 /opt/py3 /opt/py3
|
|
|
|
COPY --from=stage-2 /opt/py3 /opt/py3
|
|
|
|
COPY --from=stage-1 /usr/local/bin /usr/local/bin
|
|
|
|
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 /opt/jumpserver
|
|
|
|