I have a Dockerfile that I would like to run a script as its entrypoint. The script contains a single command with a shebang:
#!/bin/sh
screen -S mc bash -c "java -jar paper-1.18.2-387.jar"
My dockerfile looks as follows:
FROM openjdk:18-alpine
RUN apk --update add screen
WORKDIR /
COPY . ./
RUN apk add gcompat
ENV LD_PRELOAD=/lib/libgcompat.so.0
COPY run.sh /run.sh
ENTRYPOINT ["/bin/sh", "-c", "/run.sh"]
EXPOSE 25565
However, when I run the docker file the screen session that it should have attached is never executed. I have tried using the /bin/bash tag, but it tells me that it doesn't exist. I need this screen to be attached so that the docker image continues to run, and I am using screen so that I can have another session attach elsewhere.
How can I run this single command as my dockerfile entry point?
I am using WSL2 with Ubuntu 20.04.
Thanks!