Skip to content

Commit a1c8f11

Browse files
authored
updating dockerfiles to ensure all services run on docker as well.
1 parent 01aae14 commit a1c8f11

4 files changed

Lines changed: 25 additions & 14 deletions

File tree

code/chapter11/catalog/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM icr.io/appcafe/open-liberty:full-java17-openj9-ubi
2+
3+
COPY --chown=1001:0 src/main/liberty/config/ /config/
4+
5+
COPY --chown=1001:0 target/catalog.war /config/apps/
6+
7+
RUN configure.sh
8+
9+
EXPOSE 5050 5051
10+
11+
CMD ["/opt/ol/wlp/bin/server", "run", "defaultServer"]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM icr.io/appcafe/open-liberty:full-java17-openj9-ubi
2+
3+
COPY --chown=1001:0 src/main/liberty/config/ /config/
4+
5+
COPY --chown=1001:0 target/inventory.war /config/apps/
6+
7+
RUN configure.sh
8+
9+
EXPOSE 7050 7051
10+
11+
CMD ["/opt/ol/wlp/bin/server", "run", "defaultServer"]

code/chapter11/run-all-services.sh

100644100755
File mode changed.

code/chapter11/shipment/Dockerfile

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,11 @@ COPY --chown=1001:0 src/main/liberty/config/ /config/
66
# Create the app directory
77
COPY --chown=1001:0 target/shipment.war /config/apps/
88

9-
# Optional: Copy utility scripts
10-
COPY --chown=1001:0 *.sh /opt/ol/helpers/
11-
12-
# Environment variables
139
ENV VERBOSE=true
14-
15-
# This is important - adds the management of vulnerability databases to allow Docker scanning
16-
RUN dnf install -y shadow-utils
17-
18-
# Set environment variable for MP config profile
1910
ENV MP_CONFIG_PROFILE=docker
2011

21-
EXPOSE 8060 9060
12+
RUN configure.sh
2213

23-
# Run as non-root user for security
24-
USER 1001
14+
EXPOSE 8060 9060
2515

26-
# Start Liberty
27-
ENTRYPOINT ["/opt/ol/wlp/bin/server", "run", "defaultServer"]
16+
CMD ["/opt/ol/wlp/bin/server", "run", "defaultServer"]

0 commit comments

Comments
 (0)