Skip to content

Commit 1e28b71

Browse files
Added Containers examples
1 parent 69ce816 commit 1e28b71

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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

0 commit comments

Comments
 (0)