-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic-server: build a container for simple testing
Motivation: In some dev environments running a container is the preferred way, so, let provide one. Modification: Introduce multi-stage container for small image. Result: ```bash podman run -p 2049:2049 --name nfs-server docker.io/dcache/nfs4j-server:latest ``` Acked-by: Lea Morschel Target: master
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM almalinux:9-minimal as builder | ||
|
||
# Add JRE | ||
RUN microdnf -y install java-17-openjdk-devel java-17-openjdk-jmods binutils | ||
RUN jlink -v --compress=2 --strip-debug --no-header-files --no-man-pages --add-modules java.base,java.compiler,java.instrument,java.logging,java.management,java.naming,java.security.jgss,java.transaction.xa,java.xml,jdk.jfr,jdk.security.auth,jdk.unsupported --output /jlink-runtime | ||
|
||
|
||
FROM almalinux:9-minimal | ||
COPY --from=builder /jlink-runtime /jlink-runtime | ||
|
||
# add external files into container at the build time | ||
COPY run.sh /run.sh | ||
RUN chmod +x /run.sh | ||
|
||
# where we store the data | ||
RUN mkdir -p /usr/share/nfs4j | ||
|
||
# Add JARS | ||
COPY maven /usr/share/nfs4j/jars | ||
|
||
|
||
# Post-install brutal cleanup | ||
RUN microdnf clean all && rm -rf /var/cache/yum /var/lib/dnf /var/lib/rpm | ||
|
||
# expose TCP ports for network services | ||
EXPOSE 2049 | ||
|
||
# by default we start server | ||
CMD ["/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
exec /jlink-runtime/bin/java \ | ||
${JAVA_OPT} ${JMX} ${JAVA_ARGS} \ | ||
-cp "/usr/share/nfs4j/jars/*" org.dcache.nfs4j.server.Main "$@" |