How to copy files from host to Docker container?

前端 未结 30 2532
南方客
南方客 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:29

    Container Up Syntax:

     docker run -v /HOST/folder:/Container/floder 
    

    In docker File

    COPY hom* /myFolder/        # adds all files starting with "hom"
    COPY hom?.txt /myFolder/    # ? is replaced with any single character, e.g., "home.txt"
    

提交回复
热议问题