Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run jpos inside a docker container?

Tags:

I want to run jpos (isoserver) within a docker container. So far I have found this image in Docker hub. I didn't able to found any details documentation about this image. Only few lines are available in readme.

I have found few Docker files and build was successful.But when I try to run , it takes me to a bash prompt.I have run this command

docker run -t -i jpos/ubuntu_trusty_jdk8 /bin/bash

No q2 server is running. No Logs are available in docker container when i try to run this command.

sudo docker logs 7c2661e82141

Can I use existing docker image for my requirements? If yes ,where are the details documentation for how to run, modify existing docker image?

Can anybody help?

Github link

like image 365
mnhmilu Avatar asked Jun 09 '18 11:06

mnhmilu


1 Answers

You can take a look at the Docker files.

If you use the jPOS-template, you can create a Dockerfile of your own, like this:

FROM jpos/ubuntu_jdk8:latest

ADD jpos/build/distributions/jpos*.tar.gz /
LABEL vendor="jPOS.org"
LABEL org.jpos.template="2.1.1 master/2a2874f"
RUN ln -s /jpos-2.1.1 /jpos
WORKDIR /jpos

CMD ["bin/q2"]

Then you can build your image with a script like this:

!/bin/bash

cd `dirname $0`
rm -fr jpos 
git clone https://github.com/jpos/jPOS-template.git jpos
(cd jpos && gradle dist)
docker rmi jpos/template
docker build -t="jpos/yourproject" .

(You obviously clone from your project, based on jPOS-template).

Key points here:

  • gradle dist creates a distribution in build/distributions directory
  • ADD jpos/build/distributions/jpos*.tar.gz / in the Dockerfile expands the tarball inside your container.
like image 170
apr Avatar answered Oct 14 '22 20:10

apr