Last active
August 29, 2015 14:03
-
-
Save tsubakimoto/359e1d7779f019a6b069 to your computer and use it in GitHub Desktop.
いまさら聞けないDocker入門(2):ついに1.0がリリース! Dockerのインストールと主なコマンドの使い方 (1/3) - @IT http://www.atmarkit.co.jp/ait/articles/1406/10/news031.html
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 | |
apt-get update -y | |
# optional | |
# Install require packages for docker | |
apt-get install -y docker.io | |
# Docker initialize | |
update-rc.d docker.io defaults | |
ln -sf /usr/bin/docker.io /usr/local/bin/docker | |
sed -i '$acomplete -F _docker docker' /etc/bash_completion.d/docker.io | |
# Other initialize | |
gpasswd -a vagrant docker | |
newgrp docker | |
# Docker build | |
#docker build -t tsubaki/nginx:1.0 /vagrant/src | |
docker build -t tsubaki/nginx:1.1 /vagrant/src | |
# Run images | |
#docker run -d -p 80:80 --name nginx1 tsubaki/nginx:1.0 /usr/sbin/nginx -g 'daemon off;' -c /etc/nginx/nginx.conf | |
docker run -d -p 80:80 --name nginx2 tsubaki/nginx:1.1 | |
# Delete images | |
#docker stop nginx1 | |
#docker rm nginx1 | |
#docker stop nginx2 | |
#docker rm nginx2 | |
echo 'complete provisioning!' |
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
FROM ubuntu | |
MAINTAINER tsubaki <xxxx@gmail.com> | |
RUN apt-get install -y nginx | |
ADD index.html /usr/share/nginx/html/ | |
ENTRYPOINT /usr/sbin/nginx -g 'daemon off;' -c /etc/nginx/nginx.conf |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "chef/ubuntu-14.04" | |
config.vm.provision :shell, :path => "./vagrant_resources/bootstrap.sh" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment