Docker commands
There are two commands that we will be looking at. The first will be the docker container run
command so that you can see some of the items that you can use to your advantage with this command. Secondly, we will take a look at the docker container diff
command, which you can use to view what has been done with the image that you are planning to use.
Let's take a look at how we can use these two commands to help secure our containers.
The Docker Run command
With respect to the docker run
command, we will mainly focus on the option that allows you to set everything inside the container as read-only, instead of a specified directory or volume. This helps to limit the amount of damage that can be caused by malicious "applications" that could also hijack a vulnerable application by updating its binaries.
Let's take a look at how to launch a read-only container, and then break down what it does, as follows:
$ docker container run -d --name...