4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MSYS2 + Docker for Windows

Last updated at Posted at 2019-02-09

Windows10 + MSYS2 + Docker for Windows

環境変数 PATH

docker-compose.exe exec の実行には、docker.exe までPATHが通っている必要があった。

$ docker-compose exec rabbitmq bin/bash
Couldn't find `docker` binary. You might need to install Docker:

なので通しておく

export PATH="$PATH:/c/Program Files/Docker/Docker/resources/bin"

docker-compose 引数の COMMAND が変換されてしまう問題

/bin/bash がWindowsのパスに変換されてしまっている(シェル展開)

[05:03:22 pen@gray2 docker]$ winpty docker-compose.exe exec rabbitmq /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused "exec: \"C:/msys64/usr/b
in/bash.exe\": stat C:/msys64/usr/bin/bash.exe: no such file or directory": unknown

bin/bash なら変換されないのでこれで回避。
//bin/bash でもいい。

[05:03:26 pen@gray2 docker]$ winpty docker-compose.exe exec rabbitmq bin/bash
root@rabbitmq:/#

他の解決策としては、WSL から呼ぶというのもある。
WSLからWindowsのDockerを使う

4
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?