зеркало из
1
0
Форкнуть 0

update Dockerfiles for 2020-09-01-hybrid api profile (#85)

This commit is contained in:
Wei Shi 2021-06-04 11:46:49 -07:00 коммит произвёл GitHub
Родитель e7f984960f
Коммит ba66e89221
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 39 добавлений и 19 удалений

Просмотреть файл

@ -7,9 +7,9 @@ ARG AZURERM_CONTEXT_SETTINGS=AzureRmContextSettings.json
ARG AZURE=/root/.Azure
ARG VCS_REF="none"
ARG BUILD_DATE=
ARG VERSION=0.10.0
ARG VERSION=1.10.0
ARG IMAGE_NAME=mcr.microsoft.com/azure-stack-powershell:${VERSION}-centos-7
ARG AZURESTACK_PROFILE=2019-03-01-hybrid
ARG AZURESTACK_PROFILE=2020-09-01-hybrid
ARG AZURESTACK_VERSION=2.1.0
ARG READINESS_CHECKER_VERSION=1.2005.1269-preview

Просмотреть файл

@ -7,9 +7,9 @@ ARG AZURERM_CONTEXT_SETTINGS=AzureRmContextSettings.json
ARG AZURE=/root/.Azure
ARG VCS_REF="none"
ARG BUILD_DATE=
ARG VERSION=0.10.0
ARG VERSION=1.10.0
ARG IMAGE_NAME=mcr.microsoft.com/azure-stack-powershell:${VERSION}-debian-9
ARG AZURESTACK_PROFILE=2019-03-01-hybrid
ARG AZURESTACK_PROFILE=2020-09-01-hybrid
ARG AZURESTACK_VERSION=2.1.0
ARG READINESS_CHECKER_VERSION=1.2005.1269-preview

Просмотреть файл

@ -7,9 +7,9 @@ ARG AZURERM_CONTEXT_SETTINGS=AzureRmContextSettings.json
ARG AZURE=/root/.Azure
ARG VCS_REF="none"
ARG BUILD_DATE=
ARG VERSION=0.10.0
ARG VERSION=1.10.0
ARG IMAGE_NAME=mcr.microsoft.com/azure-stack-powershell:${VERSION}-ubuntu-18.04
ARG AZURESTACK_PROFILE=2019-03-01-hybrid
ARG AZURESTACK_PROFILE=2020-09-01-hybrid
ARG AZURESTACK_VERSION=2.1.0
ARG READINESS_CHECKER_VERSION=1.2005.1269-preview

Просмотреть файл

@ -22,6 +22,26 @@ The release containers derive from the [Powershell image][powershell image], and
AzureStack PowerShell [release notes](https://aka.ms/azspsdocker)
## Building Dockerfiles
Using `Dockerfile-ubuntu-18.04` as an example, here is the command to build the docker file and at the same time tagging it `mcr.microsoft.com/powershell:ubuntu-18.04`:
```sh
docker build -f .\Dockerfile-ubuntu-18.04 -t mcr.microsoft.com/powershell:ubuntu-18.04 .
```
Tagging images is useful for organizing your images. It is currently not possible to tag docker images within a dockerfile, so you will have to tag your image manually after its creation:
```sh
docker tag <image id> mcr.microsoft.com/powershell:ubuntu-18.04
```
`WARNING`: docker builds seem to break very easily. If it fails at first, try building it several times from a clean state. The `--no-cache` option ensures a clean build that doesn't use cached steps:
```sh
docker build -f .\Dockerfile-debian-9 -t mcr.microsoft.com/powershell:ubuntu-18.04 . --no-cache
```
## Examples
### Download/Update the AzureStack Powershell image
@ -34,19 +54,19 @@ docker pull mcr.microsoft.com/azurestack/powershell:<tag>
### Run AzureStack Powershell container
- To run AzureStack Powershell in a container in an interactive mode:
- To run a new container with AzureStack resources from a docker image with Powershell Core as the interactive command interface:
```sh
$ docker run -it mcr.microsoft.com/azurestack/powershell:0.1.0-ubuntu-18.04 pwsh
```
- To run AzureStack Powershell in a container:
- To start an existing container containing AzureStack resources with Powershell Core as the interactive command interface:
```sh
$ docker start -ia mcr.microsoft.com/azurestack/powershell:0.1.0-ubuntu-18.04 pwsh
```
- To run AzureStack Powershell from using a container in an interactive mode using host authentication:
- To run a container containing AzureStack resources from a docker image in an interactive Powershell Core interface using host authentication:
1. Make sure that `$HOME/.Azure` is present on the host (default location).
2. You may need to grant access this location for the docker process.
@ -64,7 +84,7 @@ docker run -it --rm -v ~/.Azure/AzureRmContext.json:/root/.Azure/AzureRmContext.
### Remove image
```sh
docker rmi mcr.microsoft.com/azurestack/powershell
docker rmi <image id>
```
### Testing
@ -81,18 +101,18 @@ docker run
Login using credentials:
```sh
./Login-Environment.ps1
[-Name <String>] # Defaults to 'AzureStack'
[-EnvironmentName <String>] # Defaults to 'AzureStack'
-ResourceManagerEndpoint <System.Uri>
-DirectoryTenantId <String>
-TenantId <String>
-Credential <PSCredential>
[-SubscriptionId <String>]
```
Login using certificates:
```sh
./Login-Environment.ps1
[-Name <String>] # Defaults to 'AzureStack'
[-EnvironmentName <String>] # Defaults to 'AzureStack'
-ResourceManagerEndpoint <System.Uri>
-DirectoryTenantId <String>
-TenantId <String>
-ApplicationId <String>
-CertificateThumbprint <String>
[-SubscriptionId <String>]
@ -110,7 +130,7 @@ Login using certificates:
```sh
./Test-AzsPowershell.ps1
[-ClientObjectId <String>] # Defaults to $ENV:ClientObjectId
[-resourceLocation <String>] # Defaults to $ENV:Location
[-Location <String>] # Defaults to $ENV:Location
```
## Developing and Contributing

Просмотреть файл

@ -11,7 +11,7 @@ param (
$ClientObjectId = $ENV:ClientObjectId,
[Parameter(HelpMessage = "The location of the resources for Azure Stack.")]
[string]
$resourceLocation = $ENV:Location
$Location = $ENV:Location
)
$resourceGroup = "azurestack-container-rg"
@ -109,7 +109,7 @@ $TestAzKeyVault =
{
$KeyVaultName = "azurestackContainerKV"
Log -Message "Creating new key vault... (New-AzKeyVault)"
New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $resourceGroup -Location $resourceLocation -Verbose -ErrorAction Stop
New-AzKeyVault -VaultName $KeyVaultName -ResourceGroupName $resourceGroup -Location $Location -Verbose -ErrorAction Stop
Get-AzKeyVault -VaultName $KeyVaultName -ErrorAction Stop
Set-AzKeyVaultAccessPolicy -VaultName $KeyVaultName -ResourceGroupName $resourceGroup -ObjectId $ClientObjectId -BypassObjectIdValidation -PermissionsToKeys all -PermissionsToSecrets all -ErrorAction Stop
@ -171,7 +171,7 @@ $TestAzNetwork =
{
$networkSecurityGroup = "network-sg"
Log -Message "Running New-AzNetworkSecurityGroup..."
New-AzNetworkSecurityGroup -ResourceGroupName $resourceGroup -Name $networkSecurityGroup -Location $resourceLocation
New-AzNetworkSecurityGroup -ResourceGroupName $resourceGroup -Name $networkSecurityGroup -Location $Location
Log -Message "Running Get-AzNetworkSecurityGroup..."
Get-AzNetworkSecurityGroup -ResourceGroupName $resourceGroup -Name $networkSecurityGroup | Format-Table -AutoSize | Out-String | Log
Log -Message "Running Remove-AzNetworkSecurityGroup..."
@ -190,7 +190,7 @@ $TestAzWebsites =
Log -Message "Running New-AzAppServicePlan..."
New-AzAppServicePlan -ResourceGroupName $resourceGroup `
-Name $appName `
-Location $resourceLocation `
-Location $Location `
-Tier "Free" `
-NumberofWorkers 1 `
-WorkerSize "Small" | Format-Table -AutoSize | Out-String | Log