What is the right way to add data to an existing named volume in Docker?

后端 未结 4 833
感情败类
感情败类 2020-11-29 16:43

I was using Docker in the old way, with a volume container:

docker run -d --name jenkins-data jenkins:tag echo \"data-only container for Jenkins\"

4条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 17:28

    You can reduce the accepted answer to one line using, e.g.

    docker run --rm -v `pwd`:/src -v my-jenkins-volume:/data busybox cp -r /src /data
    

提交回复
热议问题