DockerFile – Build a Ubuntu 18.04 docker image and update it

Last Updated on

This simple post demonstrates how to pull a Ubuntu 18.04 images and update the OS.

Stuff Used

  • Windows 10
  • Docker for Windows – Community Edition
  • PowerShell


First, we need to create a DockerFile file in some folder.

Using PowerShell

We start off with zero containers and images. This is not a requirement and there is no need to delete or remove existing containers and images.

Change Directory to Specific Directory

We change directory to the directory where the DockerFile is.

To verify the current directory, use:

Then, build an image based on our DockerFile that is inside that directory.

This will kick start the build process as follows.

Once it is done, we get the following.

To list the new images, use:

Interactively Run Container

Now we can test our image interactively:

To ensure we use the local image only, we create and run a container using an Image ID.

Alternatively, we could still use:


Karl San Gabriel

Professional Software Developer