2019年10月現在で有効だった為、忘備録として残しておく
EC2 への Docker インストール
[root@ip-172-31-46-207 ~]# sudo yum install -y docker
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
Installed:
docker.x86_64 0:18.06.1ce-10.amzn2
Dependency Installed:
libcgroup.x86_64 0:0.41-15.amzn2 libtool-ltdl.x86_64 0:2.4.2-22.2.amzn2.0.2
pigz.x86_64 0:2.3.4-1.amzn2.0.1
Complete!
[root@ip-172-31-46-207 ~]# sudo service docker start
Redirecting to /bin/systemctl start docker.service
[root@ip-172-31-46-207 ~]#
ec2-user を docker グループに追加する
$ sudo usermod -a -G docker ec2-user
EC2 への Docker Compose インストール(スーパーユーザー)
[root@ip-172-31-46-207 ~]# sudo -i
[root@ip-172-31-46-207 ~]# curl -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 617 0 617 0 0 2346 0 --:--:-- --:--:-- --:--:-- 2346
100 8066k 100 8066k 0 0 2894k 0 0:00:02 0:00:02 --:--:-- 3416k
[root@ip-172-31-46-207 ~]# chmod +x /usr/local/bin/docker-compose
[root@ip-172-31-46-207 ~]# exit
logout
[root@ip-172-31-46-207 ~]# docker-compose --version
docker-compose version 1.11.2, build dfed245
[root@ip-172-31-46-207 ~]#
###aliasを付与
[root@ip-172-31-46-207 ~]# alias d='docker'
[root@ip-172-31-46-207 ~]# alias dc='docker-compose'
参考サイト
https://qiita.com/shinespark/items/a8019b7ca99e4a30d286