-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
59 lines (47 loc) · 1.58 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
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# (1) target/*
# See the main README.md file for instructions on compiling. The compiled version is placed
# into the target directory by default.
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Compile code:
# $ mvn install
# Build Docker Image:
# $ docker build -t {tag} .
#
# Pull base image
# ---------------
FROM registry.redhat.io/ubi9/ubi-minimal
#############################################
# -------------------------------------------
# Install OpenJDK 21
# -------------------------------------------
#############################################
RUN microdnf install java-21-openjdk -y
#############################################
# -------------------------------------------
# Make Directories
# -------------------------------------------
#############################################
USER 0
RUN mkdir /opt/pgcompare \
&& chown -R 1001:1001 /opt/pgcompare
COPY docker/start.sh /opt/pgcompare/
COPY target/* /opt/pgcompare/
RUN chmod 770 /opt/pgcompare/start.sh
#############################################
# -------------------------------------------
# Copy in pgCompare Compiled Application
# -------------------------------------------
#############################################
USER 1001
# Environment variables
# -------------------------------------------------------------
ENV PGCOMPARE_HOME=/opt/pgcompare \
PGCOMPARE_CONFIG=/etc/pgcompare/pgcompare.properties \
PATH=/opt/pgcompare:$PATH
COPY target/ /opt/pgcompare/
CMD ["start.sh"]
WORKDIR "/opt/pgcompare"