1
- FROM debian:bullseye-slim as stage-wisp-build
2
- ARG TARGETARCH
3
-
4
- ARG DEPENDENCIES=" \
5
- ca-certificates \
6
- wget"
7
-
8
- ARG APT_MIRROR=http://mirrors.ustc.edu.cn
9
- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=chen \
10
- --mount=type=cache,target=/var/lib/apt,sharing=locked,id=chen \
11
- set -ex \
12
- && rm -f /etc/apt/apt.conf.d/docker-clean \
13
- && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache \
14
- && sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
15
- && apt-get update \
16
- && apt-get -y install --no-install-recommends ${DEPENDENCIES} \
17
- && echo "no" | dpkg-reconfigure dash \
18
- && apt-get clean all \
19
- && rm -rf /var/lib/apt/lists/*
20
-
21
- WORKDIR /opt
22
-
23
- ARG CHECK_VERSION=v1.0.2
24
- RUN set -ex \
25
- && wget https://github.com/jumpserver-dev/healthcheck/releases/download/${CHECK_VERSION}/check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz \
26
- && tar -xf check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz \
27
- && mv check /usr/local/bin/ \
28
- && chown root:root /usr/local/bin/check \
29
- && chmod 755 /usr/local/bin/check \
30
- && rm -f check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz
31
-
32
- ARG WISP_VERSION=v0.1.21
33
- RUN set -ex \
34
- && wget https://github.com/jumpserver/wisp/releases/download/${WISP_VERSION}/wisp-${WISP_VERSION}-linux-${TARGETARCH}.tar.gz \
35
- && tar -xf wisp-${WISP_VERSION}-linux-${TARGETARCH}.tar.gz -C /usr/local/bin/ --strip-components=1 \
36
- && chown root:root /usr/local/bin/wisp \
37
- && chmod 755 /usr/local/bin/wisp \
38
- && rm -f /opt/*.tar.gz
39
-
40
1
from node:16.20-bullseye-slim as stage-web-build
41
2
ARG TARGETARCH
42
3
ARG NPM_REGISTRY="https://registry.npmmirror.com"
@@ -46,50 +7,17 @@ RUN set -ex \
46
7
&& yarn config set registry ${NPM_REGISTRY}
47
8
48
9
WORKDIR /opt/chen/frontend
49
-
10
+ ADD frontend/package.json frontend/yarn.lock .
50
11
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=chen \
51
- --mount=type=bind,source=frontend/package.json,target=package.json \
52
- --mount=type=bind,source=frontend/yarn.lock,target=yarn.lock \
53
12
yarn install
54
13
55
14
ADD frontend .
56
-
57
15
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=chen \
58
16
yarn build
59
17
60
- FROM debian:bullseye- slim as stage-chen-build
18
+ FROM registry.fit2cloud.com/jumpserver/maven:3.9.5-openjdk-17- slim-bullseye as stage-chen-build
61
19
ARG TARGETARCH
62
20
63
- ARG DEPENDENCIES=" \
64
- ca-certificates \
65
- curl \
66
- openjdk-17-jre-headless"
67
-
68
- ARG APT_MIRROR=http://mirrors.ustc.edu.cn
69
- RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=chen \
70
- --mount=type=cache,target=/var/lib/apt,sharing=locked,id=chen \
71
- set -ex \
72
- && rm -f /etc/apt/apt.conf.d/docker-clean \
73
- && echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache \
74
- && sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
75
- && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
76
- && apt-get update \
77
- && apt-get install -y --no-install-recommends ${DEPENDENCIES} \
78
- && echo "no" | dpkg-reconfigure dash
79
-
80
- ARG MAVEN_VERSION=3.9.7
81
- ARG USER_HOME_DIR="/root"
82
- ARG BASE_URL=https://downloads.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries
83
-
84
- RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
85
- && curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
86
- && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
87
- && rm -f /tmp/apache-maven.tar.gz \
88
- && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
89
-
90
- ENV MAVEN_HOME /usr/share/maven
91
- ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
92
-
93
21
WORKDIR /opt/chen
94
22
95
23
COPY . .
@@ -99,6 +27,7 @@ ARG VERSION
99
27
ENV VERSION=$VERSION
100
28
101
29
ARG MAVEN_MIRROR=https://repo.maven.apache.org/maven2
30
+
102
31
RUN --mount=type=cache,target=/root/.m2,id=chen \
103
32
set -ex \
104
33
&& mkdir -p /root/.m2 \
@@ -108,30 +37,42 @@ RUN --mount=type=cache,target=/root/.m2,id=chen \
108
37
109
38
RUN chmod +x entrypoint.sh
110
39
111
- FROM debian:bullseye -slim
40
+ FROM registry.fit2cloud.com/jumpserver/openjdk:17 -slim-bullseye
112
41
ARG TARGETARCH
113
- ENV LANG=en_US .UTF-8
42
+ ENV LANG=zh_CN .UTF-8
114
43
115
44
ARG DEPENDENCIES=" \
116
45
ca-certificates \
117
- openjdk-17-jre-headless"
46
+ curl \
47
+ locales \
48
+ wget"
118
49
119
50
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
120
51
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=chen \
121
- --mount=type=cache,target=/var/lib/apt,sharing=locked,id=chen \
122
52
sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
53
+ && sed -i
"[email protected] =SSLv3, TLSv1, [email protected] =SSLv3@" /opt/java/openjdk/conf/security/java.security \
54
+ || sed -i
"[email protected] =SSLv3, TLSv1, [email protected] =SSLv3@" /usr/local/openjdk-17/conf/security/java.security \
123
55
&& rm -f /etc/apt/apt.conf.d/docker-clean \
124
56
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
125
57
&& apt-get update \
126
58
&& apt-get install -y --no-install-recommends ${DEPENDENCIES} \
127
59
&& echo "no" | dpkg-reconfigure dash \
128
- && sed -i
"[email protected] =SSLv3, TLSv1, [email protected] =SSLv3@" /etc/java-17-openjdk/security/java.security \
129
- && sed -i "s@# export @export @g" ~/.bashrc \
130
- && sed -i "s@# alias @alias @g" ~/.bashrc
60
+ && echo "zh_CN.UTF-8" | dpkg-reconfigure locales \
61
+ && apt-get clean all \
62
+ && rm -rf /var/lib/apt/lists/*
63
+
64
+ WORKDIR /opt
65
+
66
+ ARG WISP_VERSION=v0.1.21
67
+ RUN set -ex \
68
+ && wget https://github.com/jumpserver/wisp/releases/download/${WISP_VERSION}/wisp-${WISP_VERSION}-linux-${TARGETARCH}.tar.gz \
69
+ && tar -xf wisp-${WISP_VERSION}-linux-${TARGETARCH}.tar.gz -C /usr/local/bin/ --strip-components=1 \
70
+ && chown root:root /usr/local/bin/wisp \
71
+ && chmod 755 /usr/local/bin/wisp \
72
+ && rm -f /opt/*.tar.gz
131
73
132
74
WORKDIR /opt/chen
133
75
134
- COPY --from=stage-wisp-build /usr/local/bin /usr/local/bin
135
76
COPY --from=stage-chen-build /opt/chen/backend/web/target/web-*.jar /opt/chen/chen.jar
136
77
COPY --from=stage-chen-build /opt/chen/entrypoint.sh .
137
78
COPY --from=stage-chen-build /opt/chen/drivers /opt/chen/drivers
@@ -140,12 +81,6 @@ COPY --from=stage-chen-build /opt/chen/config/application.yml /opt/chen/config/a
140
81
ARG VERSION
141
82
ENV VERSION=$VERSION
142
83
143
- VOLUME /opt/chen/data
144
-
145
- ENTRYPOINT ["./entrypoint.sh" ]
146
-
147
84
EXPOSE 8082
148
85
149
- STOPSIGNAL SIGQUIT
150
-
151
- CMD [ "wisp" ]
86
+ CMD ["./entrypoint.sh" ]
0 commit comments