Skip to content

Commit

Permalink
feat: 更新构建
Browse files Browse the repository at this point in the history
  • Loading branch information
wojiushixiaobai committed Jan 16, 2024
1 parent d9cc89b commit 81dcfda
Show file tree
Hide file tree
Showing 19 changed files with 405 additions and 334 deletions.
49 changes: 22 additions & 27 deletions allinone/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN set -ex \
WORKDIR /opt/jumpserver

RUN set -ex \
&& wget -q https://github.com/wojiushixiaobai/jumpserver-patch/raw/master/core/Dockerfile-ce \
&& wget https://github.com/jumpserver-dev/jumpserver-patch/raw/master/core/Dockerfile-ce \
&& echo > /opt/jumpserver/config.yml \
&& cd utils \
&& bash -ixeu build.sh
Expand Down Expand Up @@ -88,15 +88,15 @@ WORKDIR /opt
ARG RUST_VERSION=1.71.1
RUN set -ex \
&& \
if [ "${TARGETARCH}" == "s390x" ] || [ "${TARGETARCH}" == "ppc64le" ] || [ "${TARGETARCH}" == "loong64" ]; then \
if [ "${TARGETARCH}" = "s390x" ] || [ "${TARGETARCH}" = "ppc64le" ] || [ "${TARGETARCH}" = "loong64" ]; then \
rustUrl="https://static.rust-lang.org/dist"; \
rustArch="${TARGETARCH}"; \
mkdir -p /opt/rust-install; \
if [ "${TARGETARCH}" == "loong64" ]; then \
if [ "${TARGETARCH}" = "loong64" ]; then \
rustUrl="download.jumpserver.org/rust/dist"; \
rustArch="loongarch64"; \
fi; \
if [ "${TARGETARCH}" == "ppc64le" ]; then \
if [ "${TARGETARCH}" = "ppc64le" ]; then \
rustArch="powerpc64le"; \
fi; \
wget -O /opt/rust.tar.gz "${rustUrl}/rust-${RUST_VERSION}-${rustArch}-unknown-linux-gnu.tar.xz"; \
Expand Down Expand Up @@ -170,12 +170,12 @@ RUN set -ex \
&& case "$dpkgArch" in \
amd64|arm64) \
echo "deb https://nginx.org/packages/debian/ buster nginx" > /etc/apt/sources.list.d/nginx.list \
&& wget -qO - https://nginx.org/keys/nginx_signing.key | apt-key add - \
&& wget -O - https://nginx.org/keys/nginx_signing.key | apt-key add - \
&& apt-get update \
;; \
loongarch64) \
echo "deb https://download.jumpserver.org/nginx/packages/debian buster nginx" > /etc/apt/sources.list.d/nginx.list \
&& wget -qO - https://download.jumpserver.org/nginx/packages/keys/nginx_signing.key | apt-key add - \
&& wget -O - https://download.jumpserver.org/nginx/packages/keys/nginx_signing.key | apt-key add - \
&& apt-get update \
;; \
*) \
Expand Down Expand Up @@ -206,15 +206,15 @@ RUN set -ex \
&& \
case "${TARGETARCH}" in \
amd64) \
wget -q https://downloads.mongodb.com/compass/mongosh-${MONGOSH_VERSION}-linux-x64.tgz \
wget https://downloads.mongodb.com/compass/mongosh-${MONGOSH_VERSION}-linux-x64.tgz \
&& tar -xf mongosh-${MONGOSH_VERSION}-linux-x64.tgz \
&& chown root:root mongosh-${MONGOSH_VERSION}-linux-x64/bin/* \
&& mv mongosh-${MONGOSH_VERSION}-linux-x64/bin/mongosh /usr/local/bin/ \
&& mv mongosh-${MONGOSH_VERSION}-linux-x64/bin/mongosh_crypt_v1.so /usr/local/lib/ \
&& rm -rf mongosh-${MONGOSH_VERSION}-linux-x64* \
;; \
arm64|s390x|ppc64le) \
wget -q https://downloads.mongodb.com/compass/mongosh-${MONGOSH_VERSION}-linux-${TARGETARCH}.tgz \
wget https://downloads.mongodb.com/compass/mongosh-${MONGOSH_VERSION}-linux-${TARGETARCH}.tgz \
&& tar -xf mongosh-${MONGOSH_VERSION}-linux-${TARGETARCH}.tgz \
&& chown root:root mongosh-${MONGOSH_VERSION}-linux-${TARGETARCH}/bin/* \
&& mv mongosh-${MONGOSH_VERSION}-linux-${TARGETARCH}/bin/mongosh /usr/local/bin/ \
Expand All @@ -230,23 +230,18 @@ ARG HELM_VERSION=v3.12.2
ARG KUBECTL_VERSION=v1.27.4
RUN set -ex \
&& \
if [ "${TARGETARCH}" == "loong64" ]; then \
wget -q https://download.jumpserver.org/public/kubectl-linux-${TARGETARCH}.tar.gz; \
if [ "${TARGETARCH}" = "loong64" ]; then \
wget https://download.jumpserver.org/public/kubectl-linux-${TARGETARCH}.tar.gz; \
tar -xf kubectl-linux-${TARGETARCH}.tar.gz; \
mv kubectl /usr/local/bin/rawkubectl; \
else \
wget -q -O /usr/local/bin/rawkubectl https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl; \
wget -O /usr/local/bin/rawkubectl https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl; \
fi \
&& wget -q http://download.jumpserver.org/public/kubectl_aliases.tar.gz \
&& wget http://download.jumpserver.org/public/kubectl_aliases.tar.gz \
&& mkdir /opt/kubectl-aliases/ \
&& tar -xf kubectl_aliases.tar.gz -C /opt/kubectl-aliases/ \
&& chown -R root:root /opt/kubectl-aliases/ \
&& \
if [ "${TARGETARCH}" == "loong64" ]; then \
wget -q https://github.com/wojiushixiaobai/helm-loongarch64/releases/download/${HELM_VERSION}/helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz; \
else \
wget -q https://get.helm.sh/helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz; \
fi \
&& wget https://get.helm.sh/helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz \
&& tar -xf helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz -C /opt --strip-components=1 linux-${TARGETARCH}/helm \
&& mv helm /usr/local/bin/rawhelm \
&& chmod 755 /usr/local/bin/rawhelm /usr/local/bin/rawkubectl \
Expand All @@ -255,7 +250,7 @@ RUN set -ex \

ARG WISP_VERSION=v0.1.16
RUN set -ex \
&& wget -q https://github.com/jumpserver/wisp/releases/download/${WISP_VERSION}/wisp-${WISP_VERSION}-linux-${TARGETARCH}.tar.gz \
&& wget https://github.com/jumpserver/wisp/releases/download/${WISP_VERSION}/wisp-${WISP_VERSION}-linux-${TARGETARCH}.tar.gz \
&& tar -xf wisp-${WISP_VERSION}-linux-${TARGETARCH}.tar.gz -C /usr/local/bin/ --strip-components=1 \
&& chown root:root /usr/local/bin/wisp \
&& chmod 755 /usr/local/bin/wisp \
Expand Down Expand Up @@ -293,7 +288,7 @@ WORKDIR /opt

RUN set -ex \
&& mkdir -p /opt/koko \
&& wget -q https://github.com/jumpserver/koko/releases/download/${VERSION}/koko-${VERSION}-linux-${TARGETARCH}.tar.gz \
&& wget https://github.com/jumpserver/koko/releases/download/${VERSION}/koko-${VERSION}-linux-${TARGETARCH}.tar.gz \
&& tar -xf koko-${VERSION}-linux-${TARGETARCH}.tar.gz -C /opt/koko/ --strip-components=1 \
&& mv /opt/koko/kubectl /usr/local/bin/ \
&& mv /opt/koko/helm /usr/local/bin/ \
Expand All @@ -303,51 +298,51 @@ RUN set -ex \

RUN set -ex \
&& mkdir -p /opt/lion \
&& wget -q https://github.com/jumpserver/lion-release/releases/download/${VERSION}/lion-${VERSION}-linux-${TARGETARCH}.tar.gz \
&& wget https://github.com/jumpserver/lion-release/releases/download/${VERSION}/lion-${VERSION}-linux-${TARGETARCH}.tar.gz \
&& tar -xf lion-${VERSION}-linux-${TARGETARCH}.tar.gz -C /opt/lion --strip-components=1 \
&& chown -R root:root /opt/lion \
&& rm -f /opt/*.tar.gz

RUN set -ex \
&& mkdir -p /opt/magnus \
&& wget -q https://github.com/jumpserver/magnus-release/releases/download/${VERSION}/magnus-${VERSION}-linux-${TARGETARCH}.tar.gz \
&& wget https://github.com/jumpserver/magnus-release/releases/download/${VERSION}/magnus-${VERSION}-linux-${TARGETARCH}.tar.gz \
&& tar -xf magnus-${VERSION}-linux-${TARGETARCH}.tar.gz -C /opt/magnus --strip-components=1 \
&& chmod 755 /opt/magnus/magnus \
&& chown -R root:root /opt/magnus \
&& rm -f /opt/*.tar.gz

RUN set -ex \
&& mkdir -p /opt/kael \
&& wget -q https://github.com/jumpserver/kael/releases/download/${VERSION}/kael-${VERSION}-linux-${TARGETARCH}.tar.gz \
&& wget https://github.com/jumpserver/kael/releases/download/${VERSION}/kael-${VERSION}-linux-${TARGETARCH}.tar.gz \
&& tar -xf kael-${VERSION}-linux-${TARGETARCH}.tar.gz -C /opt/kael --strip-components=1 \
&& chmod 755 /opt/kael/kael \
&& chown -R root:root /opt/kael \
&& rm -f /opt/*.tar.gz

RUN set -ex \
&& mkdir -p /opt/chen \
&& wget -q https://github.com/jumpserver/chen-release/releases/download/${VERSION}/chen-${VERSION}.tar.gz \
&& wget https://github.com/jumpserver/chen-release/releases/download/${VERSION}/chen-${VERSION}.tar.gz \
&& tar -xf chen-${VERSION}.tar.gz -C /opt/chen --strip-components=1 \
&& chown -R root:root /opt/chen \
&& rm -f /opt/*.tar.gz

RUN set -ex \
&& mkdir -p /opt/lina \
&& wget -q https://github.com/jumpserver/lina/releases/download/${VERSION}/lina-${VERSION}.tar.gz \
&& wget https://github.com/jumpserver/lina/releases/download/${VERSION}/lina-${VERSION}.tar.gz \
&& tar -xf lina-${VERSION}.tar.gz -C /opt/lina --strip-components=1 \
&& chown -R root:root /opt/lina \
&& rm -f /opt/*.tar.gz

RUN set -ex \
&& mkdir -p /opt/luna \
&& wget -q https://github.com/jumpserver/luna/releases/download/${VERSION}/luna-${VERSION}.tar.gz \
&& wget https://github.com/jumpserver/luna/releases/download/${VERSION}/luna-${VERSION}.tar.gz \
&& tar -xf luna-${VERSION}.tar.gz -C /opt/luna --strip-components=1 \
&& chown -R root:root /opt/luna \
&& rm -f /opt/*.tar.gz

RUN set -ex \
&& cd /opt/download/applets \
&& wget -q https://github.com/jumpserver/applets/releases/download/${VERSION}/pip_packages.zip
&& wget https://github.com/jumpserver/applets/releases/download/${VERSION}/pip_packages.zip

COPY readme.txt readme.txt
COPY entrypoint.sh .
Expand Down
83 changes: 56 additions & 27 deletions chen/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,29 @@
FROM jumpserver/openjdk:17-slim-buster as openjdk
FROM debian:buster-slim
FROM jumpserver/openjdk:17-slim-bullseye as stage-1
FROM debian:bullseye-slim as stage-2
ARG TARGETARCH
ENV LANG=en_US.UTF-8

ARG DEPENDENCIES=" \
ca-certificates \
curl \
p11-kit \
wget"

RUN set -ex \
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
set -ex \
&& rm -f /etc/apt/apt.conf.d/docker-clean \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${DEPENDENCIES} \
&& echo "no" | dpkg-reconfigure dash \
&& sed -i "s@# export @export @g" ~/.bashrc \
&& sed -i "s@# alias @alias @g" ~/.bashrc \
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/*

ENV JAVA_HOME /usr/local/openjdk-17
ENV PATH $JAVA_HOME/bin:$PATH
&& apt-get -y install --no-install-recommends ${DEPENDENCIES}

COPY --from=openjdk $JAVA_HOME $JAVA_HOME
COPY --from=openjdk /etc/ld.so.conf.d/docker-openjdk.conf /etc/ld.so.conf.d/docker-openjdk.conf
COPY --from=openjdk /etc/ca-certificates/update.d/docker-openjdk /etc/ca-certificates/update.d/docker-openjdk
WORKDIR /opt

ARG CHECK_VERSION=v1.0.1
RUN set -ex \
&& chmod +x /etc/ca-certificates/update.d/docker-openjdk \
&& /etc/ca-certificates/update.d/docker-openjdk \
&& ldconfig \
&& java -Xshare:dump \
&& rm -rf ~/.java \
&& javac --version \
&& java --version

WORKDIR /opt
&& wget https://github.com/jumpserver-dev/healthch/releases/download/${CHECK_VERSION}/check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz \
&& tar -xf check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz \
&& mv check /usr/local/bin/ \
&& chown root:root /usr/local/bin/check \
&& chmod 755 /usr/local/bin/check \
&& rm -f check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz

ARG WISP_VERSION=v0.1.16
RUN set -ex \
Expand All @@ -60,6 +48,47 @@ RUN set -ex \
COPY chen/entrypoint.sh .
RUN chmod 755 ./entrypoint.sh

FROM debian:bullseye-slim
ENV LANG=en_US.UTF-8

ARG DEPENDENCIES=" \
ca-certificates \
p11-kit"

RUN set -ex \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${DEPENDENCIES} \
&& echo "no" | dpkg-reconfigure dash \
&& sed -i "s@# export @export @g" ~/.bashrc \
&& sed -i "s@# alias @alias @g" ~/.bashrc \
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/*

ENV JAVA_HOME /usr/local/openjdk-17
ENV PATH $JAVA_HOME/bin:$PATH

COPY --from=stage-1 $JAVA_HOME $JAVA_HOME
COPY --from=stage-1 /etc/ld.so.conf.d/docker-openjdk.conf /etc/ld.so.conf.d/docker-openjdk.conf
COPY --from=stage-1 /etc/ca-certificates/update.d/docker-openjdk /etc/ca-certificates/update.d/docker-openjdk

RUN set -ex \
&& chmod +x /etc/ca-certificates/update.d/docker-openjdk \
&& /etc/ca-certificates/update.d/docker-openjdk \
&& ldconfig \
&& java -Xshare:dump \
&& rm -rf ~/.java \
&& javac --version \
&& java --version

COPY --from=stage-2 /usr/local/bin /usr/local/bin
COPY --from=stage-2 /opt/chen /opt/chen

WORKDIR /opt/chen

ARG VERSION=v3.10.1
ENV VERSION=${VERSION}

VOLUME /opt/chen/data

EXPOSE 8082
Expand Down
3 changes: 1 addition & 2 deletions chen/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
#

while [ "$(curl -I -m 10 -L -k -o /dev/null -s -w %{http_code} ${CORE_HOST}/api/health/)" != "200" ]
do
until /usr/local/bin/check ${CORE_HOST}/api/health/; do
echo "wait for jms_core ${CORE_HOST} ready"
sleep 2
done
Expand Down
Loading

0 comments on commit 81dcfda

Please sign in to comment.