-
Notifications
You must be signed in to change notification settings - Fork 207
/
Dockerfile
64 lines (47 loc) · 1.69 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
FROM jumpserver/koko-base:20241217_053647 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://deb.debian.org
RUN set -ex \
&& 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 \
&& rm -rf /var/lib/apt/lists/*
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" ]