2019-10-10 20:58:56 +07:00
|
|
|
# syntax=docker/dockerfile:experimental
|
2020-02-05 00:36:29 +07:00
|
|
|
FROM --platform=${TARGETPLATFORM:-linux/amd64} adoptopenjdk:13-jre-hotspot as suexec
|
2018-02-02 02:36:09 +07:00
|
|
|
|
2019-10-20 10:18:58 +07:00
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VCS_REF
|
|
|
|
ARG VERSION
|
|
|
|
|
2019-10-10 20:58:56 +07:00
|
|
|
ARG TARGETPLATFORM
|
|
|
|
ARG BUILDPLATFORM
|
|
|
|
RUN printf "I am running on ${BUILDPLATFORM:-linux/amd64}, building for ${TARGETPLATFORM:-linux/amd64}\n$(uname -a)\n"
|
2018-02-02 02:36:09 +07:00
|
|
|
|
2019-11-17 13:15:23 +07:00
|
|
|
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
|
|
|
|
|
2020-02-05 00:36:29 +07:00
|
|
|
FROM --platform=${TARGETPLATFORM:-linux/amd64} adoptopenjdk:13-jre-hotspot
|
2019-11-17 13:15:23 +07:00
|
|
|
|
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VCS_REF
|
|
|
|
ARG VERSION
|
|
|
|
|
2018-09-01 23:50:20 +07:00
|
|
|
LABEL maintainer="CrazyMax" \
|
2019-10-20 10:18:58 +07:00
|
|
|
org.label-schema.build-date=$BUILD_DATE \
|
2018-02-02 02:36:09 +07:00
|
|
|
org.label-schema.name="jetbrains-license-server" \
|
2018-12-03 10:46:31 +07:00
|
|
|
org.label-schema.description="JetBrains License Server" \
|
2019-10-20 10:18:58 +07:00
|
|
|
org.label-schema.version=$VERSION \
|
2018-02-02 02:36:09 +07:00
|
|
|
org.label-schema.url="https://github.com/crazy-max/docker-jetbrains-license-server" \
|
2019-10-20 10:18:58 +07:00
|
|
|
org.label-schema.vcs-ref=$VCS_REF \
|
2018-02-02 02:36:09 +07:00
|
|
|
org.label-schema.vcs-url="https://github.com/crazy-max/docker-jetbrains-license-server" \
|
|
|
|
org.label-schema.vendor="CrazyMax" \
|
|
|
|
org.label-schema.schema-version="1.0"
|
|
|
|
|
|
|
|
ENV JLS_PATH="/opt/jetbrains-license-server" \
|
2020-02-05 00:36:29 +07:00
|
|
|
JLS_VERSION="22218" \
|
|
|
|
JLS_SHA256="f68027a8b2b4f2d9b03fe0b0fef4a9ffc0fdfaf2657ab26d545777973311b601" \
|
2019-11-17 13:15:23 +07:00
|
|
|
TZ="UTC" \
|
|
|
|
PUID="1000" \
|
|
|
|
PGID="1000"
|
2018-02-02 02:36:09 +07:00
|
|
|
|
2019-10-10 20:58:56 +07:00
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install -y \
|
|
|
|
bash \
|
2019-07-23 01:38:02 +07:00
|
|
|
curl \
|
|
|
|
zip \
|
2019-10-10 20:58:56 +07:00
|
|
|
tzdata \
|
2019-10-10 21:37:50 +07:00
|
|
|
&& mkdir -p /data "$JLS_PATH" \
|
2018-02-16 08:25:45 +07:00
|
|
|
&& 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" \
|
2018-02-02 02:36:09 +07:00
|
|
|
&& chmod a+x "$JLS_PATH/bin/license-server.sh" \
|
|
|
|
&& ln -sf "$JLS_PATH/bin/license-server.sh" "/usr/local/bin/license-server" \
|
2019-11-17 13:15:23 +07:00
|
|
|
&& groupadd -f -g ${PGID} jls \
|
|
|
|
&& useradd -o -s /bin/bash -d /data -u ${PUID} -g jls -m jls \
|
2019-10-10 21:37:50 +07:00
|
|
|
&& chown -R jls. /data "$JLS_PATH" \
|
2019-10-10 20:58:56 +07:00
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
2019-11-17 13:15:23 +07:00
|
|
|
COPY --from=suexec /usr/local/bin/su-exec /usr/local/bin/su-exec
|
2019-10-10 20:58:56 +07:00
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
2019-10-10 21:37:50 +07:00
|
|
|
RUN chmod a+x /entrypoint.sh
|
2019-10-10 20:58:56 +07:00
|
|
|
|
2019-01-23 01:49:15 +07:00
|
|
|
EXPOSE 8000
|
2019-10-10 20:58:56 +07:00
|
|
|
WORKDIR /data
|
2018-02-02 02:36:09 +07:00
|
|
|
VOLUME [ "/data" ]
|
|
|
|
|
|
|
|
ENTRYPOINT [ "/entrypoint.sh" ]
|
2018-02-16 08:02:48 +07:00
|
|
|
CMD [ "/usr/local/bin/license-server", "run" ]
|
2019-08-04 14:26:54 +07:00
|
|
|
|
|
|
|
HEALTHCHECK --interval=10s --timeout=5s \
|
2019-10-10 20:26:40 +07:00
|
|
|
CMD license-server status || exit 1
|