For system, network and cloud administrators

How to view the IP of a Docker container

In order to view the IP of a Docker container, you can execute the following command:

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container-ID-or-name

How to run Docker in debug mode and view container logs?

  1. Execute the Docker events command:
docker events &
How to run Docker in debug mode and view container logs? Docker events command.
Docker events command

By this point, any Docker command that you’ll run next will be viewed with more logs.


How to remove “none” Docker images

In the process of building a Docker image, you might find yourself in the situation where a “none” image is dangling in your Docker registry, as seen below:

Listing Docker images

In order to remove the “none” Docker images, you can use:

docker rmi -f $(docker images --filter "dangling=true" -q --no-trunc)

How to log in AWS using Terraform

Terraform is a wonderful IaaC software. We can login into AWS in a couple of ways:

  • by declaring our AWS credentials (key, secret) inside one of the .tf files (main.tf, for example);
  • by declaring our AWS credentials using the Terraform CLI.


How to open a port on an Azure virtual machine using Azure CLI

If you need to open a port on your Azure virtual machine (in this case, port 80), you can use:

az vm open-port --port 80 --resource-group YourResourceGroup --name YourVMName