File tree Expand file tree Collapse file tree
Containers/Docker-examples Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM centos:7
2+ MAINTAINER "Scott Collier" <scollier@redhat.com>
3+
4+ # https://github.com/projectatomic/docker-image-examples/blob/master/rhel-httpd/Dockerfile
5+
6+ RUN yum -y update; yum clean all
7+ RUN yum -y install httpd; yum clean all
8+ RUN echo "Apache" >> /var/www/html/index.html
9+
10+ EXPOSE 80
11+
12+ # Simple startup script to avoid some issues observed with container restart
13+ ADD run-apache.sh /run-apache.sh
14+ RUN chmod -v +x /run-apache.sh
15+
16+ CMD ["/run-apache.sh"]
Original file line number Diff line number Diff line change 1+ 1) Apache on CentOS
2+
3+ docker build -t testcentos -f Dockerfile.centos-apache .
4+
5+ docker run -d -p 8085:80 testcentos
6+
7+ docker ps
8+
9+ curl localhost:8085
10+
11+ docker logs <container-id>
12+
13+
14+
15+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Make sure we're not confused by old, incompletely-shutdown httpd
4+ # context after restarting the container. httpd won't start correctly
5+ # if it thinks it is already running.
6+ rm -rf /run/httpd/*
7+
8+ exec /usr/sbin/apachectl -D FOREGROUND
You can’t perform that action at this time.
0 commit comments