This file contains 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
#!/bin/bash | |
# | |
# template script for generating CentOS container for LXC | |
# | |
# | |
# lxc: linux Container library | |
# Authors: |
This file contains 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 build -t "sshd/centos" . | |
#コンテナを起動 | |
docker run -i -t centos /bin/bash | |
#コンテナに名前を付けて起動 | |
docker run -i -t --name cent01 centos /bin/bash | |
#コンテナをバックグランドで起動 |
This file contains 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
#export OS_USERNAME=admin | |
#export OS_PASSWORD=password | |
#export OS_TENANT_NAME=demo | |
#export OS_AUTH_URL=http://192.168.10.50:5000/v2.0 | |
#export OS_AUTH_STRATEGY=keystone | |
# Common | |
DEST=/opt/stack | |
#OFFLINE=true | |
## the ip of ovs bridge br-phy is 192.168.10.50 |
This file contains 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 -d -p 5000:5000 samalba/docker-registry | |
#実験のために適当なコンテナを起動 | |
docker run -i -t -d --name cent01 centos /bin/bash | |
#起動したコンテナをコミットしてタグ付け | |
docker commit cent01 test1/centos | |
docker tag test1/centos 192.168.10.60:5000/centos_test |
This file contains 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
description "Docker daemon" | |
start on filesystem and started lxc-net | |
stop on runlevel [!2345] | |
respawn | |
script | |
DOCKER=/usr/bin/$UPSTART_JOB | |
DOCKER_OPTS= |
This file contains 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
sed 's@/usr/bin/docker -d@/usr/bin/docker -d -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock@' /etc/init/docker.conf | |
docker run -p 8000:8000 shipyard/shipyard | |
Username: admin Password: shipyard | |
なんか微妙 | |
https://github.com/dotcloud/docker/wiki/Public-docker-images |
This file contains 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
#Saucy Image create | |
#saucy install | |
sudo debootstrap saucy saucy > /dev/null | |
#useradd | |
UBUNTU_USER=ubuntu | |
UBUNTU_PASSWORD=ubuntu | |
chroot saucy useradd --create-home -s /bin/bash $UBUNTU_USER | |
chroot saucy adduser $UBUNTU_USER sudo | |
echo "$UBUNTU_USER:$UBUNTU_PASSWORD" | chroot saucy chpasswd |
This file contains 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 sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -" | |
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" | |
sudo apt-get update | |
sudo apt-get install lxc-docker-0.6.1 -y | |
vi /etc/init/docker.conf | |
# /usr/bin/docker -d | |
exec start-stop-daemon --start --chuid docker --exec /usr/bin/docker -d | |
usermod -G docker nova |
This file contains 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
git clone git@github.com:hagix9/docker_images.git | |
cat centos-60.tar.xz | docker import - centos60 | |
docker run -i -t -d -p 11111:22 --name centos01 centos60 /sbin/init | |
ssh root@localhost -p 11111 #PASSWORD: root | |
cat centos-61.tar.xz | docker import - centos61 | |
docker run -i -t -d -p 11111:22 --name centos01 centos61 /sbin/init | |
ssh root@localhost -p 11111 #PASSWORD: root | |
cat centos-62.tar.xz | docker import - centos62 |
This file contains 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
# SELinux setting | |
sed -i.bak "s/\(^SELINUX=\).*/\1disabled/" /etc/selinux/config | |
#IPv4Forwarding setting | |
sed -i.bak "s/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/" /etc/sysctl.conf | |
######################################################################################## | |
# add Repository | |
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm |
NewerOlder