2014年11月9日 星期日

play docker on windows

1. Install boot2docker
Download the installer
https://github.com/boot2docker/windows-installer/releases
This will install boot2docker, VirtualBox and git for windows

2. Start the boot2docker
Execute "Git Bash"
$ boot2docker start
$ boot2docker ip
Using the ip address to login boot2docker vm

3. Using putty to login boot2docker vm
IP: (get from previous step)
port: 22
username: docker
password: tcuser

4. create a my-data container to share folder & a samba container
docker run -v /data --name my-data busybox true
docker run --rm -v /usr/local/bin/docker:/docker -v /var/run/docker.sock:/docker.sock svendowideit/samba my-data
(you can access share file in /(boot2docker's ip)/data in host windows)

5. Run a ubuntu container
$ docker run -it --volumes-from=my-data ubuntu
$
(you will in the container, using ctrl+p ctrl+q to detach)

6. check all container status
$ docker ps -a
(container id will be list)

7. Attach previous ubuntu container
$ docker attach [Container ID]
(just key-in the few heading numbers of container ID is OK)

8. Start playing around in container (in container)
$ apt-get update
$ apt-get install xxxxx
$ exit
(Will back to boot2docker vm)

9. Commit the container to a image
$ docker commit [Contain ID] your_name/image_name:tag

10. List all docker images
$ docker images
(previous commit image will be list)

11. Run a new container on new created image
$ docker run -it --volumes-from=my-data your_name/image_name:tag
$ exit

12. Delete container
$ docker rm [Container ID]

13. Delete image
$ docker rmi [image_name]

14. Back to "Git Bash", save the status of boot2docker
$ boot2docker save
(running status of boot2docker vm is saved)

15. resume boot2docker vm
$ boot2docker up

build freeipmi rpm on centos

1. install packages
#yum install rpm-build make gcc libgcrypt-devel texinfo

2. build rpms
#rpmbuild -ta freeipmi-X.Y.Z.tar.gz

Build ipmitool 1.8.18 rpm
# bunzip2 -c ipmitool-1.8.18.tar.bz2 | gzip -c > ipmitool-1.8.18.tar.gz
# rpmbuild -ta ipmitool-1.8.18.tar.gz

The ipmitool 1.8.18 rpm file is put on ~/rpmbuild/RPMS