How to copy files from dockerfile to host?

前端 未结 5 2068
难免孤独
难免孤独 2021-01-03 22:12

I want to get some files when dockerfile built successfully, but it doesn\'t copy files from container to host.

That means when I have built dockerfile, the files

5条回答
  •  长情又很酷
    2021-01-03 22:40

    On completion of Docker Build using Dockerfile, following worked for me :

    where /var/lib/docker/ is Docker Root Dir: at my setup.

    sudo find /var/lib/docker/ -name DESIRED_FILE -type f | xargs sudo ls -hrt | tail -1 | grep tgz | xargs  -i  sudo cp -v  '{}' PATH_ON_HOST
    

提交回复
热议问题