Created
July 28, 2014 05:00
-
-
Save poad/1e6790cae23e21eb426b to your computer and use it in GitHub Desktop.
【Docker】UbuntuでCentOS5のchroot環境を構築する ref: http://qiita.com/poad1010/items/e19920507007cbfc033d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo aptitude install rinse | |
| sudo rinse --directory=${HOME}/centos --distribution=centos-5 --arc=amd64 | |
| sudo chroot ${HOME}/centos /bin/bash | |
| sudo rm -rf dev | |
| sudo mkdir -m 755 dev | |
| ( | |
| cd dev | |
| sudo ln -sf /proc/self/fd ./ | |
| sudo mkdir -m 755 pts | |
| sudo mkdir -m 1777 shm | |
| sudo mknod -m 600 console c 5 1 | |
| sudo mknod -m 600 initctl p | |
| sudo mknod -m 666 full c 1 7 | |
| sudo mknod -m 666 null c 1 3 | |
| sudo mknod -m 666 ptmx c 5 2 | |
| sudo mknod -m 666 random c 1 8 | |
| sudo mknod -m 666 tty c 5 0 | |
| sudo mknod -m 666 tty0 c 4 0 | |
| sudo mknod -m 666 urandom c 1 9 | |
| sudo mknod -m 666 zero c 1 5 | |
| ) | |
| echo 'NETWORKING=yes' | sudo tee /etc/sysconfig/network > /dev/null | |
| exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd $HOME/centos | |
| sudo tar --numeric-owner -c . | sudo docker import - localhost/centos:5.10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run -i -t localhost/centos:5.10 "/bin/echo" success |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment