Public Repository

Last pushed: 2 years ago
Short Description
nginx1.7 and php5.4
Full Description

Settings

$ sudo docker login  
Username: DockerUsername  
Password: ********  
Email: DockerEmail  

$ sudo docker pull gorohayakawa/centos7-nginx-php54:latest

$ sudo docker run --privileged -it -P -d --name centos7-nginx-php54 gorohayakawa/centos7-nginx-php54:latest  
$ sudo docker exec -it centos7-apache2 bash

Dockerfile

FROM centos:centos7
MAINTAINER Goro Hayakawa "hayao56@gmail.com"
ENV container docker

# install systemd
RUN \
  exec >& /root/build-systemd.log ;\
  set -eux ;\
  yum swap -y fakesystemd systemd initscripts epel-release vim ;\
  unlink /etc/localtime ;\
  ln -s /usr/share/zoneinfo/Japan /etc/localtime ;\
  localedef -f UTF-8 -i ja_JP ja_JP.UTF-8 ;\
  rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm ;\
  yum clean all ;\
  echo ;\
  echo "export HOME=/root" > /root/.bashrc ;\
  echo "export EDITOR=vim" >> /root/.bashrc ;\
  echo "export LANG=ja_JP.UTF-8" >> /root/.bashrc ;\
  echo "alias ls='ls --color'" >> /root/.bashrc ;\
  echo "alias vi='vim -p'" >> /root/.bashrc ;\
  echo "alias vim='vim -p'" >> /root/.bashrc ;\
  echo ;\
  echo "set smartindent" > /root/.vimrc ;\
  echo "set nowrapscan" >> /root/.vimrc ;\
  echo "set nowrap" >> /root/.vimrc ;\
  echo "set nu" >> /root/.vimrc ;\
  echo "colorscheme desert" >> /root/.vimrc ;\
  echo "highlight DiffAdd    cterm=bold ctermfg=10 ctermbg=22" >> /root/.vimrc ;\
  echo "highlight DiffDelete cterm=bold ctermfg=10 ctermbg=52" >> /root/.vimrc ;\
  echo "highlight DiffChange cterm=bold ctermfg=10 ctermbg=17" >> /root/.vimrc ;\
  echo "highlight DiffText   cterm=bold ctermfg=10 ctermbg=21" >> /root/.vimrc ;\
  echo ;\
  echo "[user]" > /root/.gitconfig ;\
  echo "    email = root@localhost.localdomain" >> /root/.gitconfig ;\
  echo "    name = root" >> /root/.gitconfig ;\
  echo "[info] done."

# root password settings
RUN yum -y install passwd ;
RUN echo 'root:root' | chpasswd ;

# install wget
RUN yum -y install wget ;

# install gpg-key
RUN wget https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 ;
RUN rpm --import RPM-GPG-KEY-EPEL-7 ;

RUN wget http://nginx.org/packages/keys/nginx_signing.key ;
RUN rpm --import nginx_signing.key ;
RUN yum list|grep nginx ;

# install nginx 1.7
RUN echo '[nginx]' > /etc/yum.repos.d/nginx.repo ;
RUN echo 'name=nginx repo' >> /etc/yum.repos.d/nginx.repo ;
RUN echo 'baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/' >> /etc/yum.repos.d/nginx.repo ;
RUN echo 'gpgcheck=1' >> /etc/yum.repos.d/nginx.repo ;
RUN echo 'enabled=1' >> /etc/yum.repos.d/nginx.repo ;
RUN yum -y --enablerepo=nginx install nginx ;

# install php5.4
RUN yum install --enablerepo=remi --nogpg -y \
  php \
  php-cli \
  php-common \
  php-devel \
  php-pdo \
  php-gd \
  php-mbstring \
  php-mcrypt \
  php-mysql \
  php-pear \
  php-xml \
  php-xmlrpc
RUN pear channel-discover pear.drush.org && pear install drush/drush
EXPOSE 80
EXPOSE 443

RUN systemctl enable nginx

ENTRYPOINT ["/sbin/init"]
Docker Pull Command
Owner
gorohayakawa