Sample Docker File

Start with Ubuntu image. Install it if necessary

FROM ubuntu

MAINTAINER Maintenance Guy main_guy@email.com

Run the normal commands to install apache under Ubuntu RUN apt-get update && apt-get -y install apache2 && apt-get clean #Set the appropriate environment variables

Who is responsible for this Dockerfile

ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_LOG_DIR /var/log/apache2 # Set the directories
RUN /bin/ln -sf ../sites-available/default-ssl \ /etc/apache2/sites-enabled/001-default-ssl RUN /bin/ln -sf ../mods-available/ssl.conf /etc/apache2/mods-enabled/ RUN /bin/ln -sf ../mods-available/ssl.load /etc/apache2/mods-enabled/ #Open the ports Apache uses to receive traffic
EXPOSE 80 EXPOSE 443 CMD [“/usr/sbin/apache2ctl”, “-D”, “FOREGROUND”]
This image creates an Apache server running on the Ubuntu Linux distribution on any platform we can run the Docker software

Leave a Reply

Your email address will not be published. Required fields are marked *