I'm new to Docker. I have a problem: I have a jar file that processes "in.png" and saves the result as a separate file: out.png. I'd like to create a docker image and put a .jar file in it. It is important that the in.png and out.png files appear / are delivered on the host side. I want to put everything on dockerhub, and ultimately allow the user to process their own graphic files. What is the best solution to this problem? I have tryed something like this (is it good solution?):
FROM java:8
WORKDIR /
ADD Hello.jar in.png
EXPOSE 8080
CMD java - jar Hello.jar
But i can't coppy (or i don't know how) output file from container to host;
Or maybe a better solution is make an image (Java / Ubuntu with Java?), uploading a .jar file to it and providing the user with a set of commands, e.g .:
docker cp Hello.jar 4e673836297e:/
docker cp in.png 4e673836297e:/
docker run ubuntu java -jar Hello.jar
docker cp 4e673836297e:/ .
Please tell me what the best solution is for this problem