Public Repository

Last pushed: a year ago
Short Description
Apache 2.4 CentOS 7 (systemd based)
Full Description
  • Dockerfile for systemd image
    FROM docker.io/centos:7
    MAINTAINER "Gilles" <gilles@serveme.beer>
    RUN yum install -y initscripts
    ENV container docker
    RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
    rm -f /lib/systemd/system/multi-user.target.wants/*;\
    rm -f /etc/systemd/system/*.wants/*;\
    rm -f /lib/systemd/system/local-fs.target.wants/*; \
    rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
    rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
    rm -f /lib/systemd/system/basic.target.wants/*;\
    rm -f /lib/systemd/system/anaconda.target.wants/*;
    VOLUME [ "/sys/fs/cgroup" ]
    CMD ["/usr/sbin/init"]
    
  • Build systemd image:
    $ docker build --rm -t local/c7-systemd .
    
  • Dockerfile for httpd image based on systemd image
    FROM local/c7-systemd
    RUN yum -y install httpd ; yum clean all ; systemctl enable httpd.service
    EXPOSE 80
    CMD ["/usr/sbin/init"]
    
  • Build httpd image
    FROM local/c7-systemd
    RUN yum -y install httpd ; yum clean all ; systemctl enable httpd.service
    EXPOSE 80
    CMD ["/usr/sbin/init"]
    
  • Create docker container based on httpd image
    $ docker run --privileged=true -d -v /sys/fs/cgroup:/sys/fs/cgroup:ro --name apache -p 8080:80 local/c7-systemd-httpd
    
Docker Pull Command
Owner
ygwane

Comments (0)