Hi Guys,
I’m completely new to Docker and I just started a small Docker-project. My goal is to dockerize a small game I wrote in Java. My game has a server and a client-side which use ZMQ for the connection.
I now worked on my Dockerfile quite a while to get the neccessary libraries like zmq and jzmq installed.
The problem i now ran into ist the following: building the Dockerfile gets me into this error:
I’ve googled this specific error for some time but no solution provided there worked for me (e.g. specifically provide the java lib path by adding -DJava… to the run command).
Here’s my Dockerfile:
#set up build environment
FROM maven:3.6.2-jdk-11 AS MAVEN_TOOL_CHAIN
COPY pom.xml /home/myshipgame/
COPY /src/ /home/myshipgame/src
COPY settings.xml /usr/share/maven/ref/
WORKDIR /home/myshipgame
RUN mvn -s /usr/share/maven/ref/settings.xml clean package
#install neccessary tools
RUN apt-get update && apt-get upgrade -y && apt-get install -y /
make /
unzip /
build-essential /
pkg-config /
libtool /
autoconf /
automake /
libzmq3-dev /
locate
#install jzmq libraries and dependencies
RUN git clone htt://github.com/zeromq/libzmq.git
RUN cd libzmq && ./autogen.sh && ./configure --prefix=/ && make && make install && ldconfig
RUN wget http://download.zeromq.org/zeromq-3.1.0-beta.zip
RUN unzip zeromq-3.1.0-beta.zip
RUN cd zeromq-3.1.0 && ./configure --prefix=/ && make && make install && ldconfig
RUN git clone https://github.com/zeromq/jzmq.git
RUN cd jzmq/jzmq-jni && ./autogen.sh && ./configure --prefix=/ && make && make install && ldconfig
#run game-server
FROM openjdk:latest
EXPOSE 12345 12345
COPY --from=MAVEN_TOOL_CHAIN /home/myshipgame/target/myshipgame-0.1.jar /lib/shipgame.jar
RUN java -jar /lib/shipgame.jar -port 12345 -seed 123 -timeout -1 -map testmap.json
Please feel free to criticize the Dockerfile or give me some tips (as I said, I’m completely new to Docker).
Anyone here that know what I have to do to get this thing up and running?
(Just for you to know: I installed all libraries on a local Ubuntu machine and the .jar file works properly)
My system: OS Ubuntu Server 18.04 LTS
Docker version: 18.09.9
Best Regards