-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathDockerfile
More file actions
76 lines (57 loc) · 2.3 KB
/
Copy pathDockerfile
File metadata and controls
76 lines (57 loc) · 2.3 KB
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
68
69
70
71
72
73
74
75
76
FROM jumpserver/lion-base:20260701_083042 AS stage-build
ARG TARGETARCH
ARG GOPROXY=https://goproxy.io
ENV CGO_ENABLED=0
ENV GO111MODULE=on
COPY . .
WORKDIR /opt/lion/ui
RUN yarn build
WORKDIR /opt/lion/
ARG VERSION
ENV VERSION=$VERSION
RUN export GOFlAGS="-X 'main.Buildstamp=`date -u '+%Y-%m-%d %I:%M:%S%p'`'" \
&& export GOFlAGS="${GOFlAGS} -X 'main.Githash=`git rev-parse HEAD`'" \
&& export GOFlAGS="${GOFlAGS} -X 'main.Goversion=`go version`'" \
&& export GOFlAGS="${GOFlAGS} -X 'main.Version=${VERSION}'" \
&& go build -trimpath -x -ldflags "$GOFlAGS" -o lion .
RUN chmod +x entrypoint.sh
FROM jumpserver/guacd:1.5.5-trixie
ARG TARGETARCH
ENV LANG=en_US.UTF-8
USER root
ARG DEPENDENCIES=" \
ca-certificates \
xz-utils"
ARG PREFIX_DIR=/opt/guacamole
ENV LD_LIBRARY_PATH=${PREFIX_DIR}/lib
ARG APT_MIRROR=http://deb.debian.org
COPY --from=stage-build /opt/s6-overlay/ /opt/s6-overlay/
RUN set -ex \
&& sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${DEPENDENCIES} \
&& apt-get install -y --no-install-recommends $(cat "${PREFIX_DIR}"/DEPENDENCIES) \
&& cp /opt/s6-overlay/s6-overlay-noarch.tar.xz /tmp/s6-overlay-noarch.tar.xz \
&& cp /opt/s6-overlay/s6-overlay-arch.tar.xz /tmp/s6-overlay-arch.tar.xz \
&& tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz \
&& tar -C / -Jxpf /tmp/s6-overlay-arch.tar.xz \
&& apt-get remove -y ghostscript xfonts-terminus \
&& apt-get -y autoremove \
&& apt-get clean all \
&& rm -rf /var/lib/apt/lists/* /opt/s6-overlay /tmp/s6-overlay-noarch.tar.xz /tmp/s6-overlay-arch.tar.xz \
&& mkdir -p /lib32 /libx32
WORKDIR /opt/lion
COPY --from=stage-build /usr/local/bin/check /usr/local/bin/check
COPY --from=stage-build /opt/lion/ui/dist ui/dist/
COPY --from=stage-build /opt/lion/lion .
COPY --from=stage-build /opt/lion/config_example.yml .
COPY --from=stage-build /opt/lion/entrypoint.sh .
COPY s6-overlay/ /etc/
RUN chmod +x /etc/cont-init.d/10-lion-init /etc/services.d/guacd/run /etc/services.d/lion/run
ARG VERSION
ENV VERSION=$VERSION
VOLUME /opt/lion/data
ENTRYPOINT ["/init"]
EXPOSE 8081
STOPSIGNAL SIGQUIT