forked from crazy-max/docker-jetbrains-license-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (48 loc) · 1.9 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
FROM --platform=${TARGETPLATFORM:-linux/amd64} adoptopenjdk:13-jre-hotspot as suexec
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN printf "I am running on ${BUILDPLATFORM:-linux/amd64}, building for ${TARGETPLATFORM:-linux/amd64}\n$(uname -a)\n"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gcc \
libc-dev \
&& curl -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c \
&& gcc -Wall /usr/local/bin/su-exec.c -o/usr/local/bin/su-exec \
&& chown root:root /usr/local/bin/su-exec \
&& chmod 0755 /usr/local/bin/su-exec
FROM --platform=${TARGETPLATFORM:-linux/amd64} adoptopenjdk:13-jre-hotspot
LABEL maintainer="CrazyMax"
ENV JLS_PATH="/opt/jetbrains-license-server" \
JLS_VERSION="24694" \
JLS_SHA256="488e0ee409631e177bdc29c32fd2cba94d080e0d5249ac48f95fb7b925d24719" \
TZ="UTC" \
PUID="1000" \
PGID="1000"
RUN apt-get update \
&& apt-get install -y \
bash \
curl \
zip \
tzdata \
&& mkdir -p /data "$JLS_PATH" \
&& curl -L "https://download.jetbrains.com/lcsrv/license-server-installer.zip" -o "/tmp/jls.zip" \
&& echo "$JLS_SHA256 /tmp/jls.zip" | sha256sum -c - | grep OK \
&& unzip "/tmp/jls.zip" -d "$JLS_PATH" \
&& rm -f "/tmp/jls.zip" \
&& chmod a+x "$JLS_PATH/bin/license-server.sh" \
&& ln -sf "$JLS_PATH/bin/license-server.sh" "/usr/local/bin/license-server" \
&& groupadd -f -g ${PGID} jls \
&& useradd -o -s /bin/bash -d /data -u ${PUID} -g jls -m jls \
&& chown -R jls. /data "$JLS_PATH" \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=suexec /usr/local/bin/su-exec /usr/local/bin/su-exec
COPY entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh
EXPOSE 8000
WORKDIR /data
VOLUME [ "/data" ]
ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "/usr/local/bin/license-server", "run" ]
HEALTHCHECK --interval=10s --timeout=5s \
CMD license-server status || exit 1