After creating container, I check with sudo docker ps and it shows like the following image.
Then I check with sudo docker ps -a and it shows it exited 36 seconds ago.
This is the code of my Dockerfile:
FROM ubuntu:14.04
MAINTAINER srini <srinivasanacg@gmail.com>
RUN apt-get update
RUN apt-get install -y apache2
RUN mkdir /var/lock/apache2
ENV APACHE_RUN_USER www_data
ENV APACHE_RUN_GROUP www_data
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_LOG_DIR /var/log/apache2
ENV LANG C
CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]
EXPOSE 80
