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
| // A Docker client configuration file to automatically set proxy variables | |
| // on every new container started by the $USER. | |
| // This configuration file should be placed in the user's home | |
| // $HOME/.docker/config.json | |
| { | |
| "proxies": { | |
| "default": { | |
| "httpProxy": "http://10.0.1.10:3128", | |
| "httpsProxy": "http://10.0.1.10:3128", |
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
| ## | |
| # Include this snippet in your .bashrc or .zshrc file to print a prettier table | |
| # to list Docker containers | |
| ## Use this alias definition to list Docker containers with the defined custom format | |
| alias dps="docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Command}}\t{{.Status}}\t{{.Names}}'" | |
| ## Use this function override to apply a custom format when listing containers with "docker ps" command | |
| function docker() { | |
| if [ $1 == "ps" ]; then |
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 | |