Coder Social home page Coder Social logo

Cannot start the image. about vs-dockerfiles HOT 6 OPEN

microsoft avatar microsoft commented on May 27, 2024
Cannot start the image.

from vs-dockerfiles.

Comments (6)

noc0lour avatar noc0lour commented on May 27, 2024

It seems that it should be "ENTRYPOINT C:\BuildTools\Common7\Tools\VsDevCmd.bat" which you can try by setting --entrypoint C:\BuildTools\Common7\Tools\VsDevCmd.bat on the docker-run commandline

Edit: This actually doesn't work.

from vs-dockerfiles.

helmesjo avatar helmesjo commented on May 27, 2024

It's --installPath that's not working. It installs it to the default path regardless (C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat).

Also the VsDevCmd.bat doesn't work:

**********************************************************************
** Visual Studio 2019 Developer Command Prompt vError 0x57: Unknown parameter: path
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************

from vs-dockerfiles.

manu3567 avatar manu3567 commented on May 27, 2024

Replace

ENTRYPOINT C:\BuildTools\Common7\Tools\VsDevCmd.bat &&
and the line following by:
ENTRYPOINT ["C:\BuildTools\Common7\Tools\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]

from vs-dockerfiles.

xmass avatar xmass commented on May 27, 2024

For me it worked to delete the last line containing the CMD ["powershell.exe"...] command. After that I'm able to build projects with the provided example command.

from vs-dockerfiles.

vhvb1989 avatar vhvb1989 commented on May 27, 2024

the ENTRYPOINT is expected for passing build command directly from VS. See: https://devblogs.microsoft.com/cppblog/using-msvc-in-a-docker-container-for-your-c-projects/#trying-it-all-out

from vs-dockerfiles.

kjczarne avatar kjczarne commented on May 27, 2024

It's --installPath that's not working. It installs it to the default path regardless (C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat).

Also the VsDevCmd.bat doesn't work:

**********************************************************************
** Visual Studio 2019 Developer Command Prompt vError 0x57: Unknown parameter: path
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************

The reason it seems to not work might be the lack of a backtick at the end of the line. Have you tried inserting one? It works for me here.

The code is:

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

And it should be:

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

from vs-dockerfiles.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.