Home > Back-end >  how to get the application folder from the docker image
how to get the application folder from the docker image

Time:04-19

this is my container running the folder /app copied from the folder express present in my image

this is my image containing the folder express

after dockerising my express app folder I deleted it from my desktop but I still have the image now I need that folder how can I get it from my image

CodePudding user response:

You can run the docker cp command (documentation: https://docs.docker.com/engine/reference/commandline/cp/). The way how to use is the following:

docker cp <container_id_or_name>:/path/in/container /path/in/host

In order to do that, you just need to run a container from the image you have, and then run the docker cp command:

# run a container as deamon
docker run -d --name my-container fahrazzzgb91/merns bash

# from your host, copy the files from the container to the host
docker cp  my-container:/path/to/copy .
  • Related