/docker-centos-httpd

Dockerized httpd (Apache HTTP Server) on CentOS 7 using self-signed certs for TLS

Primary LanguageDockerfile

Dockerized httpd (Apache HTTP Server) on CentOS 7

Development notes

Use systemd in centos:7 containers

Based on this documentation (section Systemd integration) and this post.

Self-signed certificates for TLS

Based on this tutorial.

Usage

Build the Docker image

docker build . -t docker-centos-httpd

Start the Docker container

docker run -p 8080:80 -p 8443:443 -d --cap-add=SYS_ADMIN -v /sys/fs/cgroup:/sys/fs/cgroup:ro docker-centos-httpd

Tests within the container

curl https://localhost/ # CA not trusted
curl --cacert /etc/ssl/certs/selfsigned.crt https://localhost/ # Shall work
curl localhost # Will be redirected
curl -L --cacert /etc/ssl/certs/selfsigned.crt http://localhost/ # Shall work