psdocker

Powershell Cmdlets that wrap the docker client and support the interaction with containers

View the Project on GitHub abbgrade/psdocker

New-DockerImage

SYNOPSIS

Build a docker image.

SYNTAX

New-DockerImage [-Repository] <String> [[-Tag] <String>] [[-Path] <DirectoryInfo>] [[-Timeout] <Int32>]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Builds a docker image from a Dockerfile and context directory. Wraps the command `docker build`.

EXAMPLES

EXAMPLE 1

New-DockerImage -Repository 'myapp' -Tag 'latest' -Path 'C:\\src\\myapp'

PARAMETERS

-Repository

Specifies the repository name for the image to build.

Type: String
Parameter Sets: (All)
Aliases: Name

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Tag

Specifies the tag to apply to the image. Defaults to ‘latest’.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: Latest
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Path

Specifies the directory containing the Dockerfile and build context.

Type: DirectoryInfo
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Timeout

Specifies the number of seconds to wait for the command to finish.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 4
Default value: 10
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

https://docs.docker.com/engine/reference/commandline/build/