I want create own docker image. I use a Dockerfile to create it and want to run only httpd server and mysql client. below can see my edit file. Is my Dockerfile is correct or not? # Dockerfile that modifies oraclelinux:6.6 to include an Apache HTTP serverFROM ubuntu:14.04RUN apt-get -y install apache2RUN echo HTTP server running on guest > /var/www/html/index.htmlEXPOSE 80RUN apt-get -y install mysql-clientEXPOSE 3306
Docker image create
centos
No it is not correct as you should have a CMD to run at the end.There are also several best-practises you should include to create less intermediate container snapshots and smaller output:you should not run apt-get multiple timesyou should run apt-get update before running apt-get installyou should clean up after running apt-get installyou should include a maintainerTry something like:# Dockerfile that modifies oraclelinux:6.6 to include an Apache HTTP serverFROM ubuntu:14.04MAINTAINER Supun RathnayakeRUN apt-get update && apt-get install -y \  apache2 \  mysql-client \&& apt-get clean \&& rm -rf /var/lib/apt/lists/*RUN echo HTTP server running on guest > /var/www/html/index.htmlEXPOSE 80EXPOSE 3306CMD [your command to run apache]You should probably look at docker-hub for an apache2 project with lots of downloads and analyse its Dockerfile, that is very instructive. In principle you can run your mysql client within the same container but that probably requires some scheduler to start both your apache and mysql daemon. Alternatively you should look at putting mysql somewhere else (or use one of the standard containers from Dockerhub and link them to your's).