Copy a file to a Docker container just before starting it

前端 未结 1 332
时光说笑
时光说笑 2021-01-25 01:07

I know that you can copy a file from host to a running Docker container using docker cp, but in my case I want to copy it just before starting the docker container.

相关标签:
1条回答
  • 2021-01-25 01:50

    you can do something like this:

    docker create mycon
    docker cp /myfiles/file mycon:/path/file
    docker start mycon
    
    0 讨论(0)
提交回复
热议问题