2014/02/12 Docker Meetup in Tokyo #1 での発表内容です。
デモコード: https://github.com/ydnjp/docker-continuous-integration-workflow
2014/02/12 Docker Meetup in Tokyo #1 での発表内容です。
デモコード: https://github.com/ydnjp/docker-continuous-integration-workflow
This document discusses using Docker to deploy PHP projects. It begins with an overview of some common challenges in deploying PHP projects, like different PHP version requirements across projects. It then introduces Docker and some of its key concepts like containers, images, and layered filesystems. The remainder of the document provides examples of basic Docker commands for pulling images, running containers, and listing containers. The goal is to illustrate how Docker can help isolate environments for different PHP projects and more easily manage varying PHP version requirements.
31. Dockerfileの中身
• # Getting Base Image
FROM centos:6
# start install nginx
RUN yum update -y
RUN yum install -y vim
RUN yum install -y curl
RUN yum install -y epel-release
RUN rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
RUN yum install -y nginx
RUN /etc/init.d/nginx start
RUN chkconfig nginx on
# start install ssh
RUN yum install -y openssh-server
RUN yum install -y openssh-clients
RUN sed -ri 's/#PermitRootLogin yes/PermitRootLogin yes/g' /etc/ssh/sshd_config
RUN mkdir ~/.ssh
RUN chmod 700 ~/.ssh
RUN touch ~/.ssh/authorized_keys
RUN chmod 600 ~/.ssh/authorized_keys
• # Port
EXPOSE 22 80
# echo running
CMD ["echo", "running!"]
32. ビルド
• $ docker build -t adachi/nginx_centos6:latest .
• $ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
adachin/nginx_centos6 latest 4e0eee40ab6a 2minutes ago
609.5 MB