0
1

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.

AWS EC2 Amazon Linux2でDocker, Docker Composeをインストールする(忘備)

Posted at

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

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?