-
Notifications
You must be signed in to change notification settings - Fork 202
/
Dockerfile
67 lines (51 loc) · 1.93 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM jumpserver/koko-base:20241030_063234 AS stage-build
WORKDIR /opt/koko
ARG TARGETARCH
COPY . .
ARG VERSION
ENV VERSION=$VERSION
WORKDIR /opt/koko/ui
RUN yarn build
WORKDIR /opt/koko
RUN make build -s \
&& set -x && ls -al . \
&& mv /opt/koko/build/koko /opt/koko/koko \
&& mv /opt/koko/build/helm /opt/koko/bin/helm \
&& mv /opt/koko/build/kubectl /opt/koko/bin/kubectl
RUN mkdir /opt/koko/release \
&& mv /opt/koko/locale /opt/koko/release \
&& mv /opt/koko/config_example.yml /opt/koko/release \
&& mv /opt/koko/entrypoint.sh /opt/koko/release \
&& mv /opt/koko/utils/init-kubectl.sh /opt/koko/release \
&& chmod 755 /opt/koko/release/entrypoint.sh /opt/koko/release/init-kubectl.sh
FROM debian:bullseye-slim
ARG TARGETARCH
ENV LANG=en_US.UTF-8
ARG DEPENDENCIES=" \
ca-certificates"
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
RUN set -ex \
&& rm -f /etc/apt/apt.conf.d/docker-clean \
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache \
&& sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${DEPENDENCIES} \
&& apt-get clean all \
&& echo "no" | dpkg-reconfigure dash \
&& sed -i "s@# export @export @g" ~/.bashrc \
&& sed -i "s@# alias @alias @g" ~/.bashrc
WORKDIR /opt/koko
COPY --from=stage-build /usr/local/bin/redis-cli /usr/local/bin/redis-cli
COPY --from=stage-build /opt/koko/.kubectl_aliases /opt/kubectl-aliases/.kubectl_aliases
COPY --from=stage-build /opt/koko/bin /usr/local/bin
COPY --from=stage-build /opt/koko/lib /usr/local/lib
COPY --from=stage-build /opt/koko/release .
COPY --from=stage-build /opt/koko/koko .
ARG VERSION
ENV VERSION=${VERSION}
VOLUME /opt/koko/data
ENTRYPOINT ["./entrypoint.sh"]
EXPOSE 2222
STOPSIGNAL SIGQUIT
CMD [ "./koko" ]