I did a mistake in JVM arguments setting in WebSphere after restarting docker container is not starting . I know because of my modification but How can I solve that ? I need to access docker container and without starting (I think) I could not do that .
Asked
Active
Viewed 218 times
1 Answers
1
You can do:
docker run -d your-image tail -f /dev/null
It will keep your docker running.
Then you can do:
docker exec -it your-container-id bash
Hope this helps

Jorge Chavez
- 125
- 6
-
Thanks @Jorge Chavez I already run my container and I'm just using docker run
and if I run docker run -d your-image tail -f /dev/null it will create new container right? Correct me if I'm wrong – mehdi mohammadi Sep 13 '17 at 05:19 -
Please follow [link] (https://stackoverflow.com/questions/20813486/exploring-docker-containers-file-system) and check final answer . My question is the same but the command "docker inspect -f {{.Mounts}} MyContainerId "returning [] for me. I do not know why? – mehdi mohammadi Sep 13 '17 at 06:12
-
Yes, it will keep your container alive. – Jorge Chavez Sep 13 '17 at 12:33
-
I managed to fix the issue by copying missing jar files in docker container by using docker cp {my.jar} {myContainerId}://WebSpherePath/ {my.jar} but I'm still thinking that this is the only way to keep your container alive or not? – mehdi mohammadi Sep 14 '17 at 01:07
-
Adding the ``tail -f /dev/null`` at the end is for keeping your container alive even if your app fails to start. Try to modify your Dockerfile, to perform the [COPY](https://docs.docker.com/engine/reference/builder/#copy) operations in there for your jar files. [Dockerfile documentation](https://docs.docker.com/engine/reference/builder/) – Jorge Chavez Sep 14 '17 at 13:35