-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (26 loc) · 1.02 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
FROM openjdk:jre-alpine
ARG H2_VERSION=default_version
ARG H2_RELEASEDATE=default_date
RUN --mount=type=secret,id=H2_VERSION \
--mount=type=secret,id=H2_RELEASEDATE \
export H2_VERSION=$(cat /run/secrets/H2_VERSION) && \
export H2_RELEASEDATE=$(cat /run/secrets/H2_RELEASEDATE) && \
echo ${H2_VERSION} && echo ${H2_RELEASEDATE}
LABEL name ="GeunChang Ahn"
LABEL email = "[email protected]"
LABEL version = "version-${H2_VERSION}"
LABEL description = "${H2_VERSION} upgrade"
ENV DOWNLOAD https://github.com/h2database/h2database/releases/download/version-${H2_VERSION}/h2-${H2_RELEASEDATE}.zip
ENV DATA_DIR /opt/h2-data
RUN apk add --no-cache wget
RUN mkdir -p ${DATA_DIR} \
&& wget -O h2.zip ${DOWNLOAD} \
&& unzip h2.zip -d /opt/ \
&& rm h2.zip
COPY h2.server.properties /root/.h2.server.properties
EXPOSE 81 1521
WORKDIR /opt/h2-data
CMD java -cp /opt/h2/bin/h2*.jar org.h2.tools.Server \
-web -webAllowOthers -webPort 81 \
-tcp -tcpAllowOthers -tcpPort 1521 \
-baseDir ${DATA_DIR} ${H2_OPTIONS}