Appending to PATH in a Windows Docker container

前端 未结 4 1266
别跟我提以往
别跟我提以往 2020-12-16 13:22

I need to append to the PATH within a Windows Docker container, and I\'ve tried many permutations.

ENV PATH=%PATH%;C:\\\\Foo\\\\bin
ENV PATH=$PATH;C:\\\\Foo\         


        
4条回答
  •  臣服心动
    2020-12-16 13:59

    [Environment]::SetEnvironmentVariable is a good way, but will not work in nanoserver. The best choice is:

    RUN setx path '%path%;C:\Foo\bin'
    

提交回复
热议问题