-1

I have to mention that I am new to docker world.

I have used image to create docker container for web application. When I run the application using the command:

$ docker run --privileged --name img -d -e ROOT_PASS="root" -e PRODUCT_CMD="startapp" -v /C:/w:/application -p 8080:8080 -p 1521:1521 -p 5001:5001 -p 9990:9990 app_image:1.0

the container starts. When I check the status using:

$ docker ps -a

the container has status Exited (1)

After that I tried to access the container using

$ winpty docker exec -it cntadev /bin/bash

I get the error msg: Error response from daemon: Container 4bb80921849e0fbddde4aff564c7a523aa94f163abcf54ec003ff785659c8bb0 is not running

My question: how can I check the content of the docker container to make sure that it contains all files? I am using docker desktop. Can I find the container somewhere in file system?

Ronald
  • 2,721
  • 8
  • 33
  • 44

1 Answers1

0

I'd use this approach to figure out what's the problem in an image.

NOTE: this answer works if you're in the container did never really start and you need to discover why. If the container did start and for some reasons crashed, this approach doesn't work.

Check what's the command used to start the container:

docker inspect app_image:1.0 | jq -r '.[0]["Config"]["Cmd"][0]'

Start a new container overriding the original command:

docker run --privileged \
  --name img_debugging \
  -it \
  -e ROOT_PASS="root" -e PRODUCT_CMD="startapp" \
  -v /C:/w:/application \
  -p 8080:8080 -p 1521:1521 -p 5001:5001 -p 9990:9990 \
  app_image:1.0 /bin/bash

Now you should be in the newly created container and you should be able to simply execute the original command and figure out what's breaking up from the logs.

Stefano
  • 4,730
  • 1
  • 20
  • 28