編輯歷史

時間 作者 版本
2014-05-30 04:00 – 04:12 陳幸延 r1 – r187
顯示 diff
- Untitled
+ Docker
- This pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!
+ *安裝
+ Debian
+ *# sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
+ *# apt-get update
+ *# apt-get install lxc-docker
+
+ Docker on i386
+ Building Docker from source on the Raspberry Pi | Byte Outa Life
+
+ *指令
+ *# docker run tianon/debian uname -a
+ *
+ *# docker run -i -t tianon/debian /bin/bash
+ *-i interactive
+ *-t like a terminal
+
+ *# docker run -p 80:80 myweb /usr/sbin/apache2 -D
+ *-p port 對應 host:guest
+
+ 持久資料保存
+ *# docker run -d -p 3306:3306 -v /data/mysql:/var/lib/mysql mysql
+ *-v 指定 volume
+
+
+ Detach
+ *[Ctrl]+p, [Ctrl]+q
+
+ Attach
+ *# docker attach <container-id>
+
+
+ 保存 docker 變動
+ *# docker commit <container-id> <name>
+
+
+ 檢視 docker 行程
+ *# docker ps -a
+
+ 結束 docker 行程
+ *# docker kill <container-id>
+
+ 刪除 docker container
+ *# docker rm <dontainer-id>
+
+ 刪除所有 docker container
+ *# docker rm `docker ps -notrunc -a -q`
+ *-q only show numeric IDs
+ *-notrunc Don't truncate output
+
+
+ 檢視 docker image
+ *# docker images
+
+ 刪除 docker image
+ *# docker rmi <image>
+
+
+ 備份
+ *# docker export <container-id> > ubuntu.tar
+
+ 還原
+ *# cat ubuntu.tar | docker import - my-ubuntu
+
+ *指令 - 小進階
+ # docker inspect CONTAINER|IMAGE [CONTAINER|IMAGE...]
+ # docker inspect --format='{{.NetworkSettings.IPAddress}}' $INSTANCE_ID
+
+ # sudo docker commit -run='{"Cmd": ["cat", "/world"], "PortSpecs": ["22"]}'
+ *
+ *Dockerfile
+ $ vi Dockerfile
+ *FROM ubuntu
+ *
+ *RUN apt-get update
+ *RUN apt-get insatll -y git-core
+ *
+ *RUN git clone xxxx
+ *
+ *CMD python bottle-sample/app.py
+ # docker build -t myimage .
+ Dockerfile tutorial
+
+ *官方 build server
+ auto build Docker images from Github
+
+ *個人 dockerfile
+ Carl
+ tsaikd
+
+ *啓動設定
+ 預設 docker 路徑
+ *# vi /etc/default/docker
+ *DOCKER_OPTS="-g /var/lib/docker"
+ *
+ *延伸連結
+ progrium/dokku - Docker powered mini-Heroku in around 100 lines of Bash
+ Flynn - The product that ops provides to developers
+ Continuous Integration · drone.io
+ CD - Strider Brilliant Continuous Deployment
+ coreos/etcd - A highly-available key value store for shared configuration and service discovery
+ coreos/fleet - A Distributed init System
+ Slimming down Docker containers | Intercity Blog
+ Docker Registry or How to Run your own Private Docker Image Repository | codecentric Blogcodecentric Blog
+ Link via an Ambassador Container - Docker Documentation
+ Resin.io Presentation Slides from LNUG - Resin.io allows you to 'git push' to your hardware devices. We cross-compile your code in the cloud, turn it to a Docker container, and ship it!
2014-05-30 04:00 (unknown) r0
顯示 diff
+ Untitled
+ This pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!