Bearbeiten

Freigeben über


Import-AzContainerRegistryImage

Copies an image to this container registry from the specified container registry.

Syntax

Import-AzContainerRegistryImage
      -RegistryName <String>
      -ResourceGroupName <String>
      [-SubscriptionId <String>]
      -SourceImage <String>
      [-Mode <ImportMode>]
      [-Password <String>]
      [-SourceRegistryUri <String>]
      [-SourceResourceId <String>]
      [-TargetTag <String[]>]
      [-UntaggedTargetRepository <String[]>]
      [-Username <String>]
      [-DefaultProfile <PSObject>]
      [-AsJob]
      [-NoWait]
      [-PassThru]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Import-AzContainerRegistryImage
      -RegistryName <String>
      -ResourceGroupName <String>
      [-SubscriptionId <String>]
      -Parameter <IImportImageParameters>
      [-DefaultProfile <PSObject>]
      [-AsJob]
      [-NoWait]
      [-PassThru]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Copies an image to this container registry from the specified container registry.

Examples

Example 1: Import image from a public/azure registry to an azure container registry.

Import-AzContainerRegistryImage -SourceImage library/busybox:latest -ResourceGroupName $resourceGroupName -RegistryName $RegistryName -SourceRegistryUri docker.io -TargetTag busybox:latest

Import busybox to ACR. Note: "library/" need to be add before source image. "busybox:latest" => "library/busybox:latest" Credential needed if source registry is not publicly available SourceRegistryResourceId or SourceRegistryUri is required for this cmdlet

Parameters

-AsJob

Run the command as a job

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

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Mode

When Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins.

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

-NoWait

Run the command asynchronously

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

-Parameter

. To construct, see NOTES section for PARAMETER properties and create a hash table.

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

-PassThru

Returns true when the command succeeds

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

-Password

The password used to authenticate with the source registry.

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

-RegistryName

The name of the container registry.

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

-ResourceGroupName

The name of the resource group. The name is case insensitive.

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

-SourceImage

Repository name of the source image.Specify an image by repository ('hello-world'). This will use the 'latest' tag.Specify an image by tag ('hello-world:latest').Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123').

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

-SourceRegistryUri

The address of the source registry (e.g. 'mcr.microsoft.com').

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

-SourceResourceId

The resource identifier of the source Azure Container Registry.

Type:String
Aliases:SourceRegistryResourceId
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

The ID of the target subscription. The value must be an UUID.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TargetTag

List of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted).

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UntaggedTargetRepository

List of strings of repository names to do a manifest only copy. No tag will be created.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Username

The username to authenticate with the source registry.

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

IImportImageParameters

Outputs

Boolean