Skip to content

Instantly share code, notes, and snippets.

@tsubakimoto
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubakimoto/3613000f6a2b16b418f6 to your computer and use it in GitHub Desktop.
Save tsubakimoto/3613000f6a2b16b418f6 to your computer and use it in GitHub Desktop.
【CentOS版】いまさら聞けないDocker入門(2):ついに1.0がリリース! Dockerのインストールと主なコマンドの使い方 (1/3) - @IT http://www.atmarkit.co.jp/ait/articles/1406/10/news031.html
#!/bin/bash
yum update -y
# optional
# Install require packages for docker
yum install -y http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install -y docker-io
# Docker initialize
service docker start
chkconfig docker on
usermod -a -G docker vagrant
# Docker build
docker build -t tsubaki/nginx:1.0 /vagrant/src
# Run images
docker run -d -p 80:80 --name nginx1 tsubaki/nginx:1.0
# Delete images
#docker stop nginx1
#docker rm nginx1
echo 'complete provisioning!'
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
# -*- 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/centos-6.5"
config.vm.provision :shell, :path => "./centos-docker-bootstrap.sh"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment