Skip to content

Fixes Docker image being out-of-date #7459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 3, 2018
Merged

Conversation

MiYanni
Copy link
Contributor

@MiYanni MiYanni commented Oct 3, 2018

Description

Fixes: #7286

I believe the Docker image name used to be microsoft/powershell. But, according to their docker page, it is now mcr.microsoft.com/powershell. Hopefully, this fixes our Docker image.

Checklist

@MiYanni
Copy link
Contributor Author

MiYanni commented Oct 3, 2018

Tested. It fixes the issue with the container being wrong. However, there is another issue where the module seems to be missing our ADAL dll. That can be addressed in a separate issue. Here's what I ran:

docker pull azuresdk/azure-powershell-core:dockerimage-fix
docker run -it azuresdk/azure-powershell-core:dockerimage-fix pwsh


PS /usr/local/share/powershell/Modules/Az.Profile> ls
Az.Profile.psd1                                 Microsoft.Azure.Commands.Profile.types.ps1xml                  Microsoft.Azure.PowerShell.Common.dll           Microsoft.Azure.PowerShell.Storage.Management.dll      Microsoft.WindowsAzure.Storage.dll
Az.Profile.psm1                                 Microsoft.Azure.Common.dll                                     Microsoft.Azure.PowerShell.Compute.dll          Microsoft.Azure.PowerShell.Strategies.dll              NetCoreAssemblies
Hyak.Common.dll                                 Microsoft.Azure.PowerShell.Aks.dll                             Microsoft.Azure.PowerShell.Graph.Rbac.dll       Microsoft.Azure.PowerShell.Websites.dll                PreloadAssemblies
Microsoft.ApplicationInsights.dll               Microsoft.Azure.PowerShell.Authentication.Abstractions.dll     Microsoft.Azure.PowerShell.KeyVault.dll         Microsoft.Rest.ClientRuntime.Azure.Authentication.dll
Microsoft.Azure.Commands.Profile.deps.json      Microsoft.Azure.PowerShell.Authentication.dll                  Microsoft.Azure.PowerShell.Network.dll          Microsoft.Rest.ClientRuntime.Azure.dll
Microsoft.Azure.Commands.Profile.dll            Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll  Microsoft.Azure.PowerShell.ResourceManager.dll  Microsoft.Rest.ClientRuntime.dll
Microsoft.Azure.Commands.Profile.format.ps1xml  Microsoft.Azure.PowerShell.Authorization.dll                   Microsoft.Azure.PowerShell.Storage.dll          Microsoft.WindowsAzure.Storage.DataMovement.dll
PS /usr/local/share/powershell/Modules/Az.Profile> Import-Module Az.Profile
Import-Module : Could not load file or assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.14.0.8, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
At line:1 char:1
+ Import-Module Az.Profile
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.ImportModuleCommand

Edit: Created #7460 for the issue.

@cormacpayne cormacpayne merged commit 03d6147 into preview Oct 3, 2018
@alexandair
Copy link
Contributor

@MiYanni
azuresdk/azure-powershell-core:latest still wants to run pwsh-preview at start. so the container hangs if you don't specify pwsh with docker run.

@MiYanni
Copy link
Contributor Author

MiYanni commented Oct 4, 2018

@alexandair
The term pwsh-preview doesn't exist in this codebase. So, it isn't any kind of configuration from our side. Have you tried mcr.microsoft.com/powershell to see if the issue occurs there?

@alexandair
Copy link
Contributor

I just know that I've just pulled the newer image with the "latest" tag and that image doesn't work by default. It wants to run "pwsh-preview" because this is what we did with the RC version of PowerShell Core. Now, that image uses the stable version, but somewhere in the Dockerfile used to build the image, CMD line still says pwsh-preview. I don't have another explanation why it behaves like that.

@MiYanni
Copy link
Contributor Author

MiYanni commented Oct 5, 2018

@alexandair
Does mcr.microsoft.com/powershell map to mcr.microsoft.com/powershell:latest? That's the only way that this shouldn't work correctly. Our entire Dockerfile is:

FROM mcr.microsoft.com/powershell
ARG CONFIG=Release
COPY src/Package/${CONFIG}/ResourceManager/AzureResourceManager /usr/local/share/powershell/Modules
COPY tools/InstallationTests/NetcoreTests /azpstests

I could try updating it to mcr.microsoft.com/powershell:latest instead. But, my understanding is that the :latest shouldn't be required.

@MiYanni
Copy link
Contributor Author

MiYanni commented Oct 5, 2018

@alexandair
OH! I figured it out. You're trying to pull azuresdk/azure-powershell-core:latest. It isn't published yet. It won't be published until we do another release. Wait until then.
See: https://github.com/Azure/azure-powershell/milestones

@maddieclayton maddieclayton deleted the dockerimage-fix branch October 8, 2018 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants