1
2

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.

AWS EC2 AmazonLinux 2でGitHubからクローンしたdocker-compose.ymlを動かす

Posted at

お気軽検証環境を作る必要があったのでその時のメモ。
プルするときに毎回パスワード聞いてくるようにしたかったのでcloneは意図的にhttpsを使っています。

EC2

前準備

$ sudo yum update

Gitのインストール

$ sudo yum install git
...
$ git version
git version 2.23.3

GitHubからクローン

$ git clone https://github.com/xxxx/xxxx.git
Cloning into 'xxxx'...
Username for 'https://github.com': // ユーザー名の入力
Password for 'https://xxxx@github.com': // パスワードの入力

Dockerのインストール

$ sudo amazon-linux-extras install docker
...
$ sudo service docker start

docker-compose のインストール

$ sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
...
$ sudo chmod +x /usr/local/bin/docker-compose
...
$ docker-compose --version

起動

$ docker-compose up -d

「ERROR: Couldn't connect to Docker daemon」が発生する場合

DockerでCouldn’t connect to Docker daemonが出る場合の原因と解決方法
ユーザをdockerグループに入れる

$ sudo usermod -aG docker $USER

起動時に「no space left on device」が発生する場合

EC2のボリュームを増やす

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?