For system, network and cloud administrators

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 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


How to verify if an Azure virtual machine has stopped using Azure CLI

In order to verify an Azure virtual machine’s power state, you can use:

az vm get-instance-view --resource-group YourResourceGroup --name YourVMName --query "instanceView.statuses[?starts_with(code, 'PowerState/')].displayStatus" -o tsv


How to stop/start/restart an Azure virtual machine using Azure CLI

And if you need to stop/start/restart an Azure virtual machine, you can use:

az vm stop --resource-group YourResourceGroup --name YourVMName

The stop can easily be replaced with start or restart. But if you need for the Azure CLI to return immediately and not wait for the actual restart of the virtual machine, you can also add the –no-wait flag.


Follow BusyNetwork