This repository has been archived by the owner on Jan 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
60 lines (46 loc) · 2.06 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
59
60
FROM ubuntu:18.04
MAINTAINER Jérémy Jacquier-Roux <jeremy.jacquier-roux@bonitasoft.org>
# install packages
RUN apt-get update && apt-get install -y \
curl \
gnupg2 \
mysql-client-core-5.7 \
openjdk-11-jre-headless \
postgresql-client \
unzip \
zip \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /opt/custom-init.d/
# create user to launch Bonita as non-root
RUN groupadd -r bonita -g 1000 \
&& useradd -u 1000 -r -g bonita -d /opt/bonita/ -s /sbin/nologin -c "Bonita User" bonita
# grab gosu
RUN (gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
|| gpg --keyserver ipv4.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4) \
&& curl -fsSL "https://github.com/tianon/gosu/releases/download/1.10/gosu-$(dpkg --print-architecture)" -o /usr/local/bin/gosu \
&& curl -fsSL "https://github.com/tianon/gosu/releases/download/1.10/gosu-$(dpkg --print-architecture).asc" -o /usr/local/bin/gosu.asc \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu
# use --build-arg key=value in docker build command to override arguments
ARG BONITA_VERSION
ARG BONITA_SHA256
ARG BONITA_URL
ENV BONITA_VERSION ${BONITA_VERSION:-7.9.0}
ENV BONITA_SHA256 ${BONITA_SHA256:-1e2ca16722af086715841b747c738df383018dd29ceaeb5e230e1ee2b33446ee}
ENV BONITA_URL ${BONITA_URL:-https://release.ow2.org/bonita/BonitaCommunity-${BONITA_VERSION}-tomcat.zip}
# add Bonita archive to the container
RUN mkdir /opt/files \
&& curl -fsSL ${BONITA_URL} -o /opt/files/BonitaCommunity-${BONITA_VERSION}-tomcat.zip
# display downloaded checksum
RUN sha256sum /opt/files/BonitaCommunity-${BONITA_VERSION}-tomcat.zip
# check with expected checksum
RUN echo "$BONITA_SHA256" /opt/files/BonitaCommunity-${BONITA_VERSION}-tomcat.zip | sha256sum -c -
# create Volume to store Bonita files
VOLUME /opt/bonita
COPY files /opt/files
COPY templates /opt/templates
# expose Tomcat port
EXPOSE 8080
# command to run when the container starts
CMD ["/opt/files/startup.sh"]