LoginSignup
4
4

More than 5 years have passed since last update.

amazon linuxでdockerとdocker-composeをインストール

Posted at

何故か

# yum install docker

で入らなくなっていたのでメモ。

dockerのインストール

↑のyumを打ったらメッセージが出てくるのでそのとおりに実行。

# amazon-linux-extras install docker

docker-composeのインストール

githubからソース落として設置する感じです。
gitをインストールしといたほうがいいですね。

# yum -y install git
# curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose

docker runが動かない。

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.

こんなエラーが出るので、ec2-userに権限追加。

# su - ec2-user
$ sudo groupadd docker
$ sudo gpasswd -a $USER docker
$ sudo systemctl restart docker

めでたしめでたし。

4
4
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
4
4