Skip to content

Instantly share code, notes, and snippets.

View hagix9's full-sized avatar

Shiro Hagihara hagix9

  • Fulltrust.inc
  • 7F Matsugaya 2-23-4 Matsugaya Taito-ku Tokyo-to
View GitHub Profile
@hagix9
hagix9 / gist:7335880
Last active December 27, 2015 13:49
OpenStackの仮想基板にDocker ドライバがNeutronのLinux Bridgeにしか対応していないため動かない
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
@hagix9
hagix9 / gist:7298585
Last active December 27, 2015 08:48
Docker用のOSイメージ
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
@hagix9
hagix9 / gist:7287649
Last active February 23, 2017 20:30
Dockerでプライベートリポジトリを使う
#プライベートリポジトリ用コンテナを起動
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
@hagix9
hagix9 / gist:7287293
Last active January 24, 2024 10:12
Dockerのコマンド
#ビルド
docker build -t "sshd/centos" .
#コンテナを起動
docker run -i -t centos /bin/bash
#コンテナに名前を付けて起動
docker run -i -t --name cent01 centos /bin/bash
#コンテナをバックグランドで起動
@hagix9
hagix9 / gist:7286981
Last active December 27, 2015 07:09
Docker0.6.6 Install for CentOS6.4 reference: https://github.com/sciurus/docker-rhel-rpm
# 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
@hagix9
hagix9 / gist:7284987
Last active December 27, 2015 06:58
CentOS6.4でAnsible Module for Dockerを試す https://github.com/cove/docker-ansible
#Ansibleのインストール
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install git -y
yum groupinstall "Development tools" -y
yum install PyYAML python-jinja2 python2-devel -y
yum install python-setuptools python-keyczar python-paramiko sshpass asciidoc -y
cd /usr/local/src
git clone git://github.com/ansible/ansible.git
cd ./ansible
make rpm
@hagix9
hagix9 / gist:7276134
Created November 2, 2013 06:17
Dockerfile2 redis mongodb npm
#choice container image
FROM centos
#add repository
RUN rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
#install package
RUN yum install -y passwd
RUN yum install -y openssh-server
RUN yum install -y openssh-clients
@hagix9
hagix9 / gist:7274416
Created November 2, 2013 01:24
UbuntuにDocker
#Ubuntu13.10
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 -y
sudo docker run -i -t centos /bin/bash
#Ubuntu13.04
sudo apt-get install software-properties-common
@hagix9
hagix9 / gist:7266124
Last active December 27, 2015 04:19
Dockerfile Part1
#ディレクトリ作成、移動
mkdir centos_ssh
cd centos_ssh
#コンテナイメージ作成ファイルの作成
vi Dockerfile
#choice container image
FROM centos
@hagix9
hagix9 / gist:7247663
Last active December 27, 2015 01:49
CentOS6.4にredis node.js epressとか
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/6/remi/x86_64/remi-release-6.4-1.el6.remi.noarch.rpm
yum install redis git -y
chkconfig redis on
service redis start
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
source ~/.nvm/nvm.sh
#node.jsの最新版をインストール
nvm install $(nvm ls-remote | tail -1 | awk '{print $1}')
#expressをインストール