24 lines
1.3 KiB
Plaintext
24 lines
1.3 KiB
Plaintext
|
|
// original instructions
|
|
// https://stackoverflow.com/questions/35061746/run-jar-file-in-docker-image
|
|
|
|
|
|
// build the image (only needs to be done once)
|
|
docker build -t imageName .
|
|
docker build -t ran/another-question .
|
|
|
|
// start the container
|
|
// (it may be best to just restart the program instead since this seems to wait for the program to exit)
|
|
docker run --restart unless-stopped --name myProgram imageName
|
|
docker run --restart unless-stopped --name anotherQuestion ran/another-question
|
|
|
|
|
|
// restart the program
|
|
docker restart myProgram
|
|
docker restart anotherQuestion
|
|
|
|
|
|
// if the program changes
|
|
// rebuilt it:
|
|
docker rmi imageName
|
|
docker build -t imageName . |