Appending to PATH in a Windows Docker container

前端 未结 4 1260
别跟我提以往
别跟我提以往 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 14:05

    Unfortunately ENV won't work, because windows environment variable work a little differently than linux. more info

    As of now the only way to do this is through RUN

    But you don't need to create a separate file to do this. This can be done by the following much simpler one line command:

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

提交回复
热议问题