Last active
September 18, 2017 12:14
-
-
Save efiku/62ea53e58e700dcb74f7c3f3bc718ed3 to your computer and use it in GitHub Desktop.
Revisions
-
efiku revised this gist
Sep 18, 2017 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -46,4 +46,13 @@ docker exec -it $C_N bash ``` ### Kasowanie apache pid ```sh #!/bin/sh docker stop $(docker ps -a -q); for i in `find /var/lib/docker -iname apache2.pid && find /var/lib/docker -iname php5-fpm.pid`; do rm $i; done; docker restart $(docker ps -a -q); #for i in `docker ps -a -q | grep -v X`; do docker exec -u 0 -i -t $i service php5-fpm restart; done; ``` -
efiku revised this gist
Sep 18, 2017 . 1 changed file with 11 additions and 7 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,25 +5,25 @@ Proste komendy o ktorych zapominam.. ```sh C_N='vpstest' C_P='6909' C_VOLUME_DATA="/var/www/separated-containers/${C_N}/:/var/www/" C_VOLUME_HOSTS="-v /var/vps/separated-app/${C_N}/:/etc/apache2/sites-enabled/" docker run --name $C_N -d -p $C_P:80 -v $C_VOLUME_DATA $C_VOLUME_HOSTS cloudposse/apache-php-fpm ``` **Zapisywanie stanu obecnego kontenera** ```sh C_N='zdrowie.brat.pl' docker stop $C_N # można bez stopa, ale zapisując w locie zapisujemy pid apacha docker commit $C_N backup-$C_N docker start $C_N ``` **Backup do pliku** ```sh C_N='name' C_D='/mnt/' docker save backup-$C_N > $_D$C_N.tar ``` **Restore backup** @@ -32,7 +32,8 @@ C_N='name' C_D='/mnt/' docker load -i $C_D$C_N.tar ``` Po przywroceniu trzeba zrobic docker run --name $C_N -d -p $C_P:80 -v $C_VOLUME_DATA $C_VOLUME_HOSTS cloudposse/apache-php-fpm obrazy stare pokasowac //TODO: Pomyśleć nad podmontowaniem apachowych stron jak w przykladzie. @@ -43,3 +44,6 @@ obrazy stare pokasowac C_N='name' docker exec -it $C_N bash ``` ### Kasowanie apache pid -
efiku revised this gist
Feb 21, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,7 @@ docker run --name $C_N -d -p $C_P:80 -v $C_V $C_VV cloudposse/apache-php-fpm ```sh C_N='name' docker stop $C_N # można bez stopa, ale zapisując w locie zapisujemy pid apacha docker commit $_N backup-$_N docker start $C_N ``` -
efiku revised this gist
Feb 21, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ Proste komendy o ktorych zapominam.. ### KOMENDY DOCKER **Tworzenie nowego kontenera** ```sh C_N='vpstest' C_P='6909' @@ -18,7 +18,7 @@ docker commit $_N backup-$_N docker start $C_N ``` **Backup do pliku** ```sh C_N='name' C_D='/mnt/' -
efiku revised this gist
Feb 21, 2017 . 1 changed file with 14 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ Proste komendy o ktorych zapominam.. ### KOMENDY DOCKER * Tworzenie nowego kontenera * ```sh @@ -10,25 +10,35 @@ C_VV='-v /home/efik/vps-data/apache2/sites/' docker run --name $C_N -d -p $C_P:80 -v $C_V $C_VV cloudposse/apache-php-fpm ``` **Zapisywanie stanu obecnego kontenera** ```sh C_N='name' docker stop $C_N docker commit $_N backup-$_N docker start $C_N ``` ** Backup do pliku *** ```sh C_N='name' C_D='/mnt/' docker save bak-$C_N > $_D$C_N.tar ``` **Restore backup** ```sh C_N='name' C_D='/mnt/' docker load -i $C_D$C_N.tar ``` Po przywroceniu trzeba zrobic docker run -p .. -n... ale $C_N obrazy stare pokasowac //TODO: Pomyśleć nad podmontowaniem apachowych stron jak w przykladzie. ### Wchodzenie do kontenera ```sh C_N='name' docker exec -it $C_N bash ``` -
efiku revised this gist
Feb 21, 2017 . 1 changed file with 34 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,34 @@ Proste komendy o ktorych zapominam.. ### test * Tworzenie nowego kontenera * ```sh C_N='vpstest' C_P='6909' C_V='/var/www/:/var/www/' C_VV='-v /home/efik/vps-data/apache2/sites/' docker run --name $C_N -d -p $C_P:80 -v $C_V $C_VV cloudposse/apache-php-fpm ``` * Zapisywanie stanu obecnego kontenera ```sh C_N='name' docker stop $C_N docker commit $_N backup-$_N docker start $C_N ``` * Backup do pliku * ```sh C_N='name' C_D='/mnt/' docker save bak-$C_N > $_D$C_N.tar ``` *Restore backup* ```sh C_N='name' C_D='/mnt/' docker load -i $C_D$C_N.tar ``` Po przywroceniu trzeba zrobic docker run -p .. -n... ale $C_N -
efiku created this gist
Feb 21, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ Test # test