This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
wiki:qclug_presentations:docker:demo [2015/02/11 04:02] Travis Vaske created |
wiki:qclug_presentations:docker:demo [2015/02/11 04:07] (current) Travis Vaske |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| docker search centos | grep php | docker search centos | grep php | ||
| - | #Pull down and run command Hello World on your container | + | Pull down and run command Hello World on your container |
| - | docker run jdeathe/centos-ssh-apache-php echo "hello" | + | * docker run jdeathe/centos-ssh-apache-php echo "hello" |
| - | #View the history of what your ran in your container | + | #View the history of what you ran in your container |
| - | docker ps -a | + | * docker ps -a |
| #Run another command from your container | #Run another command from your container | ||
| - | docker run jdeathe/centos-ssh-apache-php echo "hello2" | + | * docker run jdeathe/centos-ssh-apache-php echo "hello2" |
| #Interactive Login of your container | #Interactive Login of your container | ||
| - | docker run -i -t jdeathe/centos-ssh-apache-php /bin/bash | + | * docker run -i -t jdeathe/centos-ssh-apache-php /bin/bash |
| #Interactive Login of your container attaching it to a local port 81 | #Interactive Login of your container attaching it to a local port 81 | ||
| - | docker run -i -t -p 192.168.1.101:81:80 jdeathe/centos-ssh-apache-php /bin/bash | + | * docker run -i -t -p 192.168.1.101:81:80 jdeathe/centos-ssh-apache-php /bin/bash |
| #Copy wiki files | #Copy wiki files | ||
| - | rsync -axP 192.168.1.101:/var/www/ /var/www/ | + | * rsync -axP 192.168.1.101:/var/www/ /var/www/ |
| - | rsync -axP 192.168.1.101:/etc/httpd/ /etc/httpd/ | + | * rsync -axP 192.168.1.101:/etc/httpd/ /etc/httpd/ |
| #start httpd | #start httpd | ||
| - | service httpd start | + | * service httpd start |
| When i Exit i loose everything that i just did :( | When i Exit i loose everything that i just did :( | ||
| I guess ill try to commit my changes and create my own image | I guess ill try to commit my changes and create my own image | ||
| - | docker commit <imagename> | + | * docker commit <imagename> |
| #Run docker container using local drives, interactive | #Run docker container using local drives, interactive | ||
| - | docker run -i -t -p 192.168.1.101:81:80 -v /var/www:/var/www -v /etc/httpd/:/etc/httpd/ jdeathe/centos-ssh-apache-php /bin/bash | + | * docker run -i -t -p 192.168.1.101:81:80 -v /var/www:/var/www -v /etc/httpd/:/etc/httpd/ |
| + | * jdeathe/centos-ssh-apache-php /bin/bash | ||
| #Run docker container user local drives, damonized | #Run docker container user local drives, damonized | ||
| - | docker run -d -p 192.168.1.101:81:80 -v /var/www:/var/www -v /etc/httpd/:/etc/httpd/ jdeathe/centos-ssh-apache-php /usr/sbin/httpd -DFOREGROUND | + | * docker run -d -p 192.168.1.101:81:80 -v /var/www:/var/www -v /etc/httpd/:/etc/httpd/ jdeathe/centos-ssh-apache-php /usr/sbin/httpd -DFOREGROUND |
| This still isnt good enough for me i want it to me more automated | This still isnt good enough for me i want it to me more automated | ||
| DOCKERFILE | DOCKERFILE | ||
| - | Copy all data from local host via RSYNC and run the container attaching it to port 81 of my lo | + | * Copy all data from local host via RSYNC and run the container attaching it to port 81 of my lo |
| cal host | cal host | ||
| DOCKERFILE WITH DATA CONTAINER | DOCKERFILE WITH DATA CONTAINER | ||
| - | Copy all data from local host to a data container to allow change | + | * Copy all data from local host to a data container to allow change |
| DEPLOY WORDPRESS SITE | DEPLOY WORDPRESS SITE | ||
| - | Combine multiple images from dockerhub to build a functional WORDPRESS Site | + | * Combine multiple images from dockerhub to build a functional WORDPRESS Site |