When we use our knowledge on how to host Docker image sources on GitHub and how to publish images on the Docker Registry Hub, it'll be no problem creating our data volume image.
Let's create a branch and a Dockerfile and add the content for our data volume image:
git checkout -b data vi Dockerfile git add Dockerfile
On line number 2 in the preceding code, you can use the text editor of your choice. I just happen to find
vi suits my needs. The content you should add to the Dockerfile is this:
FROM busybox:latest MAINTAINER Oskar Hane <firstname.lastname@example.org> RUN mkdir /var/lib/mysql && mkdir /var/www/html VOLUME ["/var/lib/mysql", "/var/www/html"]
Replace the maintainer information with your name and e-mail.
You can—and should—always ...