Docker: Run Image as Container

The docker run command serves for creating containers from images.

In this article i will show how to run a Docker image as a container on the example of the official latest base image of Ubuntu.

I will show how to install apache2 inside a container with Ubuntu and how to save this container as a new image.

And finally i will show how to run this new Docker image as a container in the both interactive and background modes. (more…)

Docker: Pull Command – Examples

The docker pull command serves for downloading Docker images from a registry.

By default, the docker pull command pulls images from Docker Hub, but it is also possible to manually specify the private registry to pull from.

Before running the docker pull command it needs to search the Docker registry for the image to download.

In the examples below i will show how to pull the CentOS image from the official repository. (more…)

Docker: Remove Image – Remove All Images – Remove Unused

To delete a particular Docker image firstly you have to find out the IMAGE ID by listing the all local Docker images.

When the image for deletion is identified it can be removed with the docker rmi command.

From the command-line it is also possible to remove unused Docker images (not used by any containers) or, if it is needed, you can force removal of the all locally downloaded Docker images. (more…)

Docker: Remove Container – Remove All Containers

To delete a particular Docker container firstly you have to find out the CONTAINER ID or NAME by listing the all Docker containers.

When the container for deletion is identified it can be removed with the docker rm command.

From the command-line it is also possible to remove stopped (unused) Docker containers only or, if it is needed, you can force removal of the all Docker containers. (more…)

Git – Revert File to Previous Commit

Sometimes it happens that you make some changes to a file but later realize that it was a mistake and these changes have to be discarded.

In Git you can revert the changes made to a file if you haven’t committed them yet, as well as you can revert a file to any previous commit.

Here i will show how to revert a single file to a specific revision and how to reset an uncommitted file to the initial master’s state. (more…)