This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.local
67 lines (59 loc) · 2.47 KB
/
Dockerfile.local
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
61
62
63
64
65
66
67
FROM ubuntu:20.04
# Get arguments from the build command line
ARG version_reg_app
ENV REGISTRY_MANAGER_HOME=/var/local/registry
ENV VERSION_REG_APP=$version_reg_app
# Build up the OS
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y curl \
maven \
openjdk-11-jdk-headless \
tar
# Make room for the app
RUN mkdir /usr/local/registry-app-${VERSION_REG_APP}
# Copy the data into the building container
COPY README.md /usr/local/registry-app-${VERSION_REG_APP}
COPY SECURITY.md /usr/local/registry-app-${VERSION_REG_APP}
COPY LICENSE.md /usr/local/registry-app-${VERSION_REG_APP}
COPY NOTICE.txt /usr/local/registry-app-${VERSION_REG_APP}
COPY pom.xml /usr/local/registry-app-${VERSION_REG_APP}
COPY settings.xml /usr/local/registry-app-${VERSION_REG_APP}
COPY src /usr/local/registry-app-${VERSION_REG_APP}/src
# Build the application and deploy it inside the container
RUN cd /usr/local/registry-app-${VERSION_REG_APP} && \
mvn compile && \
mvn site && \
mvn package
# Build up all of the bin files for general use
RUN mkdir -p /usr/local/dist \
/var/local/registry/elastic \
/var/local/harvest/archive \
/var/local/harvest/output && \
cd /usr/local/registry-app-${VERSION_REG_APP} && \
cp target/harvest-*/bin/harvest \
target/registry-manager-*/bin/registry-manager \
/usr/local/bin/ && \
cp target/harvest-*/dist/* \
target/registry-manager-*/dist/* \
/usr/local/dist/ && \
cp target/registry-manager-*/elastic/* /var/local/registry/elastic/ && \
ln -s /var/local/registry/elastic /usr/local && \
cp -r target/harvest-*/conf /var/local/harvest/ && \
( sed -e 's/\/path\/to\/bundle/\/var\/local\/harvest\/archive/' \
target/harvest-*/conf/examples/bundles.xml | \
sed -e 's/CHANGE_ME/PSA/' > \
/var/local/harvest/conf/examples/bundles.xml ) && \
cp -r target/*/dph_example_archive/* /var/local/harvest/archive
# 🤔 TODO: Are these packages needed at run-time?
# - curl
# - maven
# - tar
# If not, they should be uninstalled in a final `RUN` statement.
#
# Regardless, `/var/alib/apt/lists/*` should always be deleted at the end.
#
# Also: Running `mvn` within a Dockerfile is a little odd. Having files like
# `SECURITY.md` or `NOTICE.txt` in an image doesn't feel quite right! 😅
#
# 🤔 TODO: Is `ubuntu` the right base image? How about `openjdk:11-slim`?