In this recipe, we are going to see the complete life cycle of a Docker image by using PowerShell Docker cmdlets in conjunction with Docker CLI commands:
- Open a Terminal and enter root mode.
- Launch PowerShell using pwsh.
- Log in to the Docker registry using your Docker username and password credentials or using a standard file as an input for the password. The second option is not recommended, for security reasons:
# docker login
- Now, pull the sample hello-world:latest image from the Docker Hub using the Pull-ContainerImage cmdlet:
PS> Pull-ContainerImage hello-world:latest
- To run the container image, use the Run-ContainerImage ...