2. About Me
•
About me
•
Work at numerinfo.com
•
Organizor of
http://www.meetup.com/Docker-Taipei/
•
https://github.com/waitingkuo
•
waitinguo0527@gmail.com
14. Play Docker via Vagrant
•
Install vagrant & virtualbox
•
$ git clone https://github.com/waitingkuo/dockervagrant.git
$ cd docker-vagrant
$ vagrant up
$ vagrant ssh
•
Start to play docker
15. Download a pre-built image
•
$ docker pull ubuntu
•
You can find more images here
https://index.docker.io/
23. Finally, you can use pip
•
$ docker run mypip pip install bottle
•
$ docker commit <container-id> mybottle
24. Time to run a web server
•
Run a simple website using bottle framework
•
https://github.com/waitingkuo/bottle-sample
25. Clone our project!
•
First, we need git
•
$ docker run mybottle apt-get install git-core
•
uuuh… Seems we need to do apt-get update
26. Apt-get update and
install again
•
$ docker run mybottle apt-get update
•
$ docker commit <container-id> myupdate
•
$ docker run myupdate apt-get install git-core
•
$ docker commit <container-id> mygit
27. Clone our project part 2
•
$ docker run mygit git clone https://github.com/
waitingkuo/bottle-sample.git
•
docker commit <container-id> myweb
28. Bottle Rock
•
$ docker run myweb python bottle-sample/app.py
•
htttp://192.168.66.66:8080
(192.168.66.66 is the ip for the virtual machine we
create by vagrant)
•
What the fuckrock??
33. Example
Dockerfile
•
FROM ubuntu
RUN apt-get update
RUN apt-get install -y git-core
RUN apt-get install -y python-pip
RUN pip install bottle
RUN git clone https://github.com/waitingkuo/bottle-sample.git
CMD python bottle-sample/app.py
34. Build image by Dockerfile
•
$ docker built -t myweb-2 . # don’t forget the .
•
Now, you have a new image, myweb-2
•
$ docker image
•
$ docker run -p 9999:8080 myweb-2 python bottlesample/app.py
35. Think about GitHub
•
We have already had docker commit
•
Can I push my image to something like GitHub?