23
14

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 5 years have passed since last update.

docker-compose buildが通らなくて辛かった話

Posted at

原因はよくわからないのだけどEC2でdocker-compose buildが通らなくなった

こんな感じ

[ec2-user]$ docker-compose build
db uses an image, skipping
Building web
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

issueをみたらsudoを使えと書いてあったので使うと

[ec2-user]$ sudo docker-compose build
sudo: docker-compose: command not found

みつからないとと言われる

え?と思い他のコマンドを試すと普通に動く

[ec2-user]$ sudo docker up
............

原因はよくわからなかったが、docker-compose buildだけ通らない。

しょうがないので

$ which docker-compose
/usr/local/bin/docker-compose

でdocker-compose の場所を探して

$ sudo /usr/local/bin/docker-compose build

で直接指定したら動いた。

23
14
0

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
23
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?