docker run -it -d --name test-baseimage baseimage:1.0 docker exec -it test-baseimage /bin/sh run the below commands in the test-baseimage container sh-4.4# java sh ...