| external help file | psdocker-help.xml |
|---|---|
| Module Name | psdocker |
| online version | https://abbgrade.github.io/psdocker/docs/Uninstall-DockerImage.html |
| schema | 2.0.0 |
Remove a Docker image.
Uninstall-DockerImage [[-Name] <String>] [-Force] [-NoPrune] [[-Timeout] <Int32>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
Removes a local image, optionally forcing removal or preventing removal of untagged parent images. Supports -WhatIf and -Confirm.
# Prerequisites: Docker is running and can pull images from Microsoft Container Registry.
Install-DockerImage -Repository 'mcr.microsoft.com/powershell' -Tag 'latest' | Out-Null
$repository = "psdocker-example-$([guid]::NewGuid().ToString('N'))"
$buildContext = Join-Path $env:TEMP $repository
New-Item -Path $buildContext -ItemType Directory | Out-Null
Set-Content -Path (Join-Path $buildContext 'Dockerfile') -Value 'FROM mcr.microsoft.com/powershell:latest'
New-DockerImage -Repository $repository -Path $buildContext
Get-DockerImage -Repository $repository -Tag 'latest' |
Uninstall-DockerImage -Force
Remove-Item -Path $buildContext -Recurse -Force
Builds a uniquely named temporary image, then removes it through the pipeline. Captured output: No output. The image is removed.
Specifies the name of the image to be removed.
Type: String
Parameter Sets: (All)
Aliases: Image, ImageName
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: FalseRemoves the image even if a container is using it.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalsePrevents removal of untagged parent images.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies how long to wait for the command to finish.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: 10
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
https://abbgrade.github.io/psdocker/docs/Uninstall-DockerImage.html
https://docs.docker.com/engine/reference/commandline/image_rm/