-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathDockerfile-base
More file actions
48 lines (37 loc) · 1.59 KB
/
Copy pathDockerfile-base
File metadata and controls
48 lines (37 loc) · 1.59 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
FROM golang:1.26.3-trixie AS stage-go-build
FROM node:20-trixie
COPY --from=stage-go-build /usr/local/go/ /usr/local/go/
COPY --from=stage-go-build /go/ /go/
ENV GOPATH=/go
ENV PATH=/go/bin:/usr/local/go/bin:$PATH
ARG TARGETARCH
ARG NPM_REGISTRY="https://registry.npmmirror.com"
ENV NPM_REGISTY=$NPM_REGISTRY
ARG S6_OVERLAY_VERSION=3.2.2.0
RUN set -ex \
&& npm config set registry ${NPM_REGISTRY} \
&& yarn config set registry ${NPM_REGISTRY}
WORKDIR /opt
RUN set -ex \
&& wget https://github.com/jumpserver-dev/healthcheck/releases/latest/download/check_linux_${TARGETARCH}.deb \
&& dpkg -i check_linux_${TARGETARCH}.deb \
&& rm -f check_linux_${TARGETARCH}.deb
RUN set -ex \
&& case "${TARGETARCH}" in \
amd64) s6_arch="x86_64" ;; \
arm64) s6_arch="aarch64" ;; \
*) echo "Unsupported TARGETARCH: ${TARGETARCH}" >&2; exit 1 ;; \
esac \
&& mkdir -p /opt/s6-overlay \
&& wget -O /opt/s6-overlay/s6-overlay-noarch.tar.xz "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" \
&& wget -O /opt/s6-overlay/s6-overlay-arch.tar.xz "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${s6_arch}.tar.xz"
WORKDIR /opt/lion/ui
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=lion \
--mount=type=bind,source=ui/package.json,target=package.json \
--mount=type=bind,source=ui/yarn.lock,target=yarn.lock \
yarn install
ENV CGO_ENABLED=0
ENV GO111MODULE=on
WORKDIR /opt/lion
COPY go.mod go.sum ./
RUN go mod download -x