Creating an image with A Dockerfile

Standard

The Dockerfile

Simply a file or manifest that has all the commands needed to be run to create an image when you run ‘docker build’. You can find more information here: Dockerfile docs

Simple Dockerfile

Just to keep it simple a Dockerfile can be as simple as installing packages after setting up a server and creating some directories. Here’s an example:

Here is a Dockerfile I used for a virtual host apache image:
https://github.com/mfung/alpine_apache2_php7

Commands

Some commands when dealing with building an image:

 

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.