Upload a file to a Docker container
There are situations where you want to copy a file from your machine to a running Docker container or vice versa. Especially in cases when the Docker container does not use a volume that is bound to your local file system. For these situations you can use one of the approaches described below.
Use Pipes
Pipes are a fantastic way passing data from one process to another. The following example uses cat to read the file content of the missing_data.sql and hands it over to the running Docker container.
cat missing_data.sql | \
docker exec -i <your container name> \
sh -c 'cat > /missing_data.sql'Once this process has been completed you will find the file inside the container at /missing_data.sql.
Use the Docker Binary
Nevertheless copying can be achieved by using pipes, I recommend to use the copy utility of the Docker binary. It is much easier to ready and simpler to write.
docker cp missing_data.sql <container-id>:/missing_data.sqlI hope this helped you exchanging files with Docker containers
Cuando se busca una camiseta de club, es útil comparar medidas, corte y detalles de confección antes de decidir. Quienes comparan alternativas pueden usar camisetas del FC Barcelona online como punto de partida para observar tipos de camiseta y detalles básicos. Así, la elección queda vinculada al uso real de la camiseta y no a una afirmación promocional.