User Tools

Site Tools


wiki:qclug_presentations:docker:demo

This is an old revision of the document!


DEMO

docker search centos | grep php

Pull down and run command Hello World on your container

  • Unordered List Itemdocker run jdeathe/centos-ssh-apache-php echo “hello”

#View the history of what your ran in your container

  • Unordered List Itemdocker ps -a

#Run another command from your container

  • Unordered List Itemdocker run jdeathe/centos-ssh-apache-php echo “hello2”

#Interactive Login of your container

  • Unordered List Itemdocker run -i -t jdeathe/centos-ssh-apache-php /bin/bash

#Interactive Login of your container attaching it to a local port 81

  • Unordered List Itemdocker run -i -t -p 192.168.1.101:81:80 jdeathe/centos-ssh-apache-php /bin/bash

#Copy wiki files

  • Unordered List Itemrsync -axP 192.168.1.101:/var/www/ /var/www/
  • Unordered List Itemrsync -axP 192.168.1.101:/etc/httpd/ /etc/httpd/

#start httpd

  • Unordered List Itemservice httpd start

When i Exit i loose everything that i just did :(

I guess ill try to commit my changes and create my own image

  • Unordered List Item docker commit <imagename>

#Run docker container using local drives, interactive

  • Unordered List Itemdocker run -i -t -p 192.168.1.101:81:80 -v /var/www:/var/www -v /etc/httpd/:/etc/httpd/
  • Unordered List Itemjdeathe/centos-ssh-apache-php /bin/bash

#Run docker container user local drives, damonized

  • Unordered List Itemdocker 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

DOCKERFILE Copy all data from local host via RSYNC and run the container attaching it to port 81 of my lo cal host

DOCKERFILE WITH DATA CONTAINER Copy all data from local host to a data container to allow change

DEPLOY WORDPRESS SITE Combine multiple images from dockerhub to build a functional WORDPRESS Site

wiki/qclug_presentations/docker/demo.1423627532.txt.gz · Last modified: 2015/02/11 04:05 by Travis Vaske