skip to Main Content

I have a program which creates files and i need to create these files to user into a project-folder outside of container. When im using docker container these files creates inside of container, but i need to share them to users outside of container to local of my folder with a project.

i saw docker cp but im need for an automatically copying solution.

2

Answers


  1. Chosen as BEST ANSWER

    Thanks you guys for helps!

    my solution:

    docker run -v $(pwd)/result_folder:/<project_folder>/result_folder <container_name>
    

  2. You can achieve by docker volume & bind mount, where you will be able to bind a host volume to container volume. You need to make sure the permission while doing volume bind is correct. You can refer to the following document:

    1. https://docs.docker.com/engine/storage/volumes/ -as in the comment and
    2. https://docs.docker.com/engine/storage/bind-mounts/
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search