Skip to content
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

Update nano server insider for new bulid #4555

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ Install-Module <ModuleName> -Scope CurrentUser

#### Docker run requires full path

> **Note:** this is fixed in `10.0.16257.1000` of the NanoServer-Insider build. The powershell version of this should be released soon.

Due to [an issue with the container not picking up the path](https://github.com/Microsoft/Virtualization-Documentation/blob/live/virtualization/windowscontainers/quick-start/Insider-Known-Issues.md#build-16237), you must specify the path
when running a command on the command line. For example, you would expect to be able to run:

Expand Down
28 changes: 23 additions & 5 deletions docker/release/nanoserver-insider/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# escape=`
# Args used by from statements must be defined here:
ARG NanoServerVersion=10.0.16237.1001
ARG WindowsServerCoreVersion=10.0.16237.1001
ARG NanoServerVersion=10.0.16257.1000
ARG WindowsServerCoreVersion=10.0.16257.1000
ARG WindowsServerCoreRepo=microsoft/windowsservercore-insider
ARG NanoServerRepo=microsoft/nanoserver-insider

Expand All @@ -21,18 +21,36 @@ RUN Expand-Archive powershell.zip -DestinationPath \PowerShell

# Install PowerShell into NanoServer
FROM ${NanoServerRepo}:$NanoServerVersion

ARG VCS_REF="none"
ARG PS_VERSION=6.0.0-beta.5
ARG IMAGE_NAME=microsoft/nanoserver-insider-powershell

LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>"
LABEL readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md"
LABEL description="This Dockerfile will install the latest release of PS."

# Usage on URL to Usage
LABEL org.label-schema.usage="https://github.com/PowerShell/PowerShell/tree/master/docker#run-the-docker-image-you-built"
LABEL org.label-schema.url="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md"
LABEL org.label-schema.vcs-url="https://github.com/PowerShell/PowerShell"
# Image friendly name
LABEL org.label-schema.name="nanoserver-insider-powershell"
LABEL org.label-schema.vcs-ref=${VCS_REF}
LABEL org.label-schema.vendor="PowerShell"
LABEL org.label-schema.version=${PS_VERSION}
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.docker.cmd="docker run ${IMAGE_NAME} powershell -c '$psversiontable'"
LABEL org.label-schema.docker.cmd.devel="docker run ${IMAGE_NAME}"
LABEL org.label-schema.docker.cmd.test="docker run ${IMAGE_NAME} powershell -c Invoke-Pester"
LABEL org.label-schema.docker.cmd.help="docker run ${IMAGE_NAME} powershell -c Get-Help"
# Copy Powershell from the installer containter
ENV ProgramFiles C:\Program Files
COPY --from=installer-env ["\\PowerShell\\", "$ProgramFiles\\PowerShell"]

# Persist %PSCORE% ENV variable for user convenience
ENV PSCORE="$ProgramFiles\PowerShell\PowerShell.exe"

# setx /M fails on nanoserver-insider, setting the user path
# Set the path
RUN setx PATH "%PATH%;%ProgramFiles%\PowerShell"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, setx /M is not necessary on nanoserver because it's a single user OS, correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct, they fixed the container to use the per user path.


CMD ["C:\\Program Files\\PowerShell\\PowerShell.exe"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In docker/README.md:

Due to an issue with the container not picking up the path, you must specify the path when running a command on the command line.

Looks like the PATH issue has been fixed, so the document should be updated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a note that it will be fixed soon. I have to setup a build machine matching the exact build of the container, which might take me some time.

CMD ["PowerShell.exe"]