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

后端 未结 4 843
感情败类
感情败类 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 don't need to start some container to add data to already existing named volume, just create a container and copy data there:

    docker container create --name temp -v my-jenkins-volume:/data busybox
    docker cp . temp:/data
    docker rm temp
    

提交回复
热议问题