Skip to content

Instantly share code, notes, and snippets.

@jacoyutorius
Last active November 11, 2016 22:02
Show Gist options
  • Select an option

  • Save jacoyutorius/f0488d6285e943f2727e to your computer and use it in GitHub Desktop.

Select an option

Save jacoyutorius/f0488d6285e943f2727e to your computer and use it in GitHub Desktop.
Docker事始め その2。Dockerfileを作ってみる ref: http://qiita.com/jacoyutorius/items/1ed47a5b82ab8c173ff8
FROM centos
MAINTAINER Yuto Ogi <[email protected]>
RUN echo "install ruby environment"
RUN yum install -y git vim sudo tar wget
RUN yum install -y gcc make gcc-c++ zlib-devel httpd-devel openssl-devel curl-devel sqlite-devel
RUN cd /root/ && wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.gz
RUN cd /root/ && tar zxvf ruby-2.1.1.tar.gz
RUN cd /root/ruby-2.1.1 && ./configure && make && make install
RUN gem install bundler --no-ri --no-rdoc -V
RUN gem install rb-readline --no-ri --no-rdoc -V
RUN echo "Install rails"
RUN gem install rails --no-ri --no-rdoc -V
RUN echo rails -v
RUN git clone https://github.com/jacoyutorius/todolist.git
WORKDIR /todolist
RUN bundle install
EXPOSE 3000
RUN rails s
docker@boot2docker:~$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
yuto/centos rails 2087cad9f6c1 5 days ago 1.483 GB
docker build -t yuto/centos .
Uploading context 3.072 kB
Uploading context
Step 0 : FROM centos
---> bee3be095dae
Step 1 : MAINTAINER Yuto Ogi <[email protected]>
---> Using cache
---> a7b42e461fb7
~ 省略 ~
=> Booting WEBrick
=> Rails 4.0.2 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2014-05-07 12:43:32] INFO WEBrick 1.3.1
[2014-05-07 12:43:32] INFO ruby 2.1.1 (2014-02-24) [x86_64-linux]
[2014-05-07 12:43:32] INFO WEBrick::HTTPServer#start: pid=1 port=3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment