diff options
Diffstat (limited to 'containers')
-rw-r--r-- | containers/compiler/Dockerfile | 5 | ||||
-rw-r--r-- | containers/compiler/execute.sh | 5 | ||||
-rw-r--r-- | containers/runner/Dockerfile | 8 | ||||
-rw-r--r-- | containers/runner/execute.sh | 4 |
4 files changed, 22 insertions, 0 deletions
diff --git a/containers/compiler/Dockerfile b/containers/compiler/Dockerfile new file mode 100644 index 0000000..6849c8f --- /dev/null +++ b/containers/compiler/Dockerfile @@ -0,0 +1,5 @@ +FROM eclipse-temurin:23-jdk +COPY --chmod=700 ./execute.sh /execute.sh +RUN mkdir -p /opt/src +WORKDIR /opt/src +ENTRYPOINT ["/execute.sh"] diff --git a/containers/compiler/execute.sh b/containers/compiler/execute.sh new file mode 100644 index 0000000..6831a8b --- /dev/null +++ b/containers/compiler/execute.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +EXEC_DIR=/tmp/exec + +timeout 60 sh -c "javac -Xlint:deprecation '$APPLICATION_NAME.java' -d '$EXEC_DIR' > /dev/null" diff --git a/containers/runner/Dockerfile b/containers/runner/Dockerfile new file mode 100644 index 0000000..ebb15ad --- /dev/null +++ b/containers/runner/Dockerfile @@ -0,0 +1,8 @@ +FROM eclipse-temurin:23-jdk +RUN mkdir /home/nobody +WORKDIR /home/nobody +ARG EXEC_DIR_HOST +USER 65534 +COPY --chmod=700 --chown=nobody containers/runner/execute.sh /home/nobody/execute.sh +COPY --chmod=700 --chown=nobody ${EXEC_DIR_HOST} /home/nobody/exec +ENTRYPOINT ["/home/nobody/execute.sh"] diff --git a/containers/runner/execute.sh b/containers/runner/execute.sh new file mode 100644 index 0000000..1597f0d --- /dev/null +++ b/containers/runner/execute.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +cd "/home/nobody/exec" +java "$APPLICATION_NAME" |