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

Unable to reliably build containers #7

Closed
ablaylock opened this issue May 15, 2019 · 7 comments
Closed

Unable to reliably build containers #7

ablaylock opened this issue May 15, 2019 · 7 comments

Comments

@ablaylock
Copy link

ablaylock commented May 15, 2019

I am having spurious results installing the visual studio build tools in a docker container. Here are the host system details:

Host OS

  • Windows 10 Pro
  • Version 1809
  • OS Build 17763.503

Docker Desktop

  • Version 2.0.0.3 (31259)
  • Build 8858db3

Dockerfile

# escape=`

# Two days ago I was successful with this docker base image:
#FROM microsoft/windowsservercore:ltsc2016

# I have tried the following which result in error codes 255 and 2147483651 from the Install.cmd  RUN command below
#FROM mcr.microsoft.com/windows/servercore:ltsc2019
#FROM microsoft/dotnet-framework:3.5-sdk-windowsservercore-1709
#FROM mcr.microsoft.com/windows:1809
FROM mcr.microsoft.com/windows:1809-amd64

# Reset the shell
SHELL ["cmd", "/S", "/C"]

# Set up environment to collect install errors.
COPY Install.cmd C:\TEMP\
ADD https://aka.ms/vscollect.exe C:\TEMP\collect.exe

# Download channel for fixed install.
ARG CHANNEL_URL=https://aka.ms/vs/16/release/channel
ADD ${CHANNEL_URL} C:\TEMP\VisualStudio.chman

# Download and install Build Tools for Visual Studio 2019 for native desktop workload.
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
RUN C:\TEMP\Install.cmd C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
    --channelUri C:\TEMP\VisualStudio.chman `
    --installChannelUri C:\TEMP\VisualStudio.chman `
    --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended`
    --installPath C:\BuildTools

# Use developer command prompt and start PowerShell if no other command specified.
ENTRYPOINT C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=x86 &&
CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]

SHELL ["powershell"]
RUN iex ((New-Object System.Net.WebClient). DownloadString('https://chocolatey.org/install.ps1'))
RUN choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y --no-progress

It seems there is no consistency in being able to install the build tools in any of the windows containers.

I was able to get the native-desktop image to build but it includes a bunch of stuff I didn't want and I was also interested in using VS 2019.

Additionally the top FROM directive (servercore:ltsc2019) worked two days ago but my computer was having issues with Explorer.exe so I reinstalled windows.
vslogs_2147483651.zip
vslogs_255.zip

@heaths
Copy link
Member

heaths commented May 16, 2019

There are restrictions, such as you can't install .NET Framework as part of the VS install into Windows containers, which don't install .NET Framework (at least certain versions) by default. Attempts will fail in unpredictable ways, which is why examples start with a dotnet-framework tagged image.

To troubleshoot further, logs are needed. Given the sporadic nature, this could be a connection issue through your configured network (nat, transparent, or otherwise).

@ablaylock
Copy link
Author

I meant to include the logs. I have edited the original post and added the log. I did see the logs with 255 in the name was failing to add .NET. I will look at what .NET images are available and try that.

@ablaylock
Copy link
Author

ablaylock commented May 16, 2019

Could you recommend a FROM line for installing VS 2019? I have tried FROM mcr.microsoft.com/dotnet/framework/sdk:4.7.2 and FROM microsoft/dotnet-framework:4.7.2-sdk-windowsservercore-1709 both of which failed. See the attached logs.
vslogs_2147483651_4.7.2_sdk.zip
vslogs_2147483651_4.7.2-sdk-windowsservercore-1709.zip

@heaths
Copy link
Member

heaths commented May 16, 2019

Neither log is showing an install error. They are showing that the install succeeded, actually. Sure it's not one of the subsequent commands? The errors correspond to ERROR_CLIENT_SERVER_PARAMETERS_INVALID (could be an issue with your Docker install) and HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), which could be anywhere.

@ablaylock
Copy link
Author

Given the logs zip were generated and only command that is capable of generated them is the VS install that would pretty conclusively point to the vs install failing. Am I thinking about that wrong? I am going to look through the logs and maybe capture the output from the docker run as well.

@ablaylock
Copy link
Author

I have attached the shell output from running the log vslogs_2147483651_4.7.2-sdk-windowsservercore-1709.zip here. You can see at the end where I copy out the zip.
error_run.txt

@ablaylock
Copy link
Author

I reinstalled windows and now the images are building reliably, I think something may have gotten broken with docker or another program I installed was interfering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants