This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Disable duplicate commands | |
| export HISTCONTROL=ignoredups | |
| # Save commands from several terminals to common history | |
| export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r;" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Копирование в Docker | |
| #Чтобы узнать имя или ID контейнера, выполните команду docker ps: | |
| #$ docker ps | |
| #CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
| #72ca2488b353 my_image X hours ago Up X hours my_container | |
| # Скопировать файл с хоста в контейнер: | |
| docker cp foo.txt 72ca2488b353:/foo.txt | |
| #Скопировать файл с Docker-контейнера на хост: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE |