× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

How to start Apache Docker Contianer and link to a DB service

Jason Gegere
Feb 05, 2015
<p>This original quick tip was posted years ago while it is still valid, much has changed, with more energy and time going into Docker improving build processes it would be worth while to create a "<a href="https://github.com/htmlgraphic/Apache/blob/envoyer/Makefile">Makefile</a>" to help increase reliability and reduce errors.</p> <p> </p> <p># Creating data container<br> $docker run --name db-data -v /var/lib/mysql busybox /bin/sh</p> <p> </p> <p><span style="color:rgb(95, 99, 102)"># Start Apache service </span><br> $ docker run -d -p 80:80 -p 443:443 --link mysql:mysql -v ~/Dropbox/SITES/docker:/data --name apache htmlgraphic/apache<br>  </p> <p><span style="color:rgb(95, 99, 102)"># Create MySQL instance</span><br> $ docker run -d --restart=always -p 3306:3306 --volumes-from db-data --name mysql htmlgraphic/mysql</p> <p> </p>
comments powered by Disqus