Search This Blog

Monday, November 18, 2019

Docker cheatsheet

copy files to docker container



docker cp foo.txt mycontainer:/foo.txt
docker cp mycontainer:/foo.txt foo.txt
docker cp src/. mycontainer:/target
docker cp mycontainer:/src/. target


docker ps /docker history imagename  / docker exec -it container /bin/bash


docker command line volume will mount host folder to container volume, and volume tag in docker file will initate an empty volume on /var/lib/docker/blablabla


Remove containers 

docker rm -v container name // to delete volumes
docker inspect containername |grep volume


Backup docker images   tar


docker save name 
docker load name 

Backup live containers // wont bkup volumes


docker commit/docker export/docker import 


backup docker volume'





















No comments:

Post a Comment