How to copy files from host to Docker container?

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

    You can just trace the IP address of your local machine using

    ifconfig
    

    Then just enter into your Docker container and type

    scp user_name@ip_address:/path_to_the_file destination
    

    In any case if you don't have an SSH client and server installed, just install it using:

    sudo apt-get install openssh-server
    

提交回复
热议问题