How to copy files from host to Docker container?

前端 未结 30 2956
南方客
南方客 2020-11-22 06:58

I am trying to build a backup and restore solution for the Docker containers that we work with.

I have Docker base image that I have created, ubuntu:base

30条回答
  •  误落风尘
    2020-11-22 07:26

    This is a onliner for copying a single file while running a tomcat container.

    docker run -v /PATH_TO_WAR/sample.war:/usr/local/tomcat/webapps/myapp.war -it -p 8080:8080 tomcat
    

    This will copy the war file to webapps directory and get your app running in no time.

提交回复
热议问题