docker build command add 'C:/Program Files/Git' to the path passed as build argument when executed in MINGW bash on Windows

前端 未结 2 1236
说谎
说谎 2021-02-19 17:43

I have following Dockerfile:

FROM ubuntu:16.04

ARG path1=def_path1
RUN mkdir ${path1}

When I build this Dockerfile using following command:

2条回答
  •  無奈伤痛
    2021-02-19 18:22

    Further to @mat007's answer:

    This bash function solved the problem more permanently for docker, without enabling MSYS_NO_PATHCONV globally, which causes another world of pain.

    .bashrc

    # See https://github.com/docker/toolbox/issues/673#issuecomment-355275054
    # Workaround for Docker for Windows in Git Bash.
    docker()
    {
            (export MSYS_NO_PATHCONV=1; "docker.exe" "$@")
    }
    

    You may need to do the same for docker-compose

提交回复
热议问题