This article uses Amazon Linux 2 on AWS to do the following:
First, update yum as follows.
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo yum update -y
Then install docker.
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo amazon-linux-extras install docker -y
After the installation is complete, start the docker daemon.
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo service docker start
Add ec2-user to the docker group.
This is not required, but you can now use the `docker``` command without
`sudo```.
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo usermod -a -G docker ec2-user
After executing the above command, close the terminal once. Then reconnect.
First, start the container with the `run``` command. If the image has not been pulled, you can pull it before launching. The option
`-it``` allows you to enter inside the launched container.
(... is written by omitting the displayed message)
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ docker run -it centos
・
・
・
[root@xxx /]#
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ yum install python3 -y
By entering the python3
command as shown below, you can enter interactive mode and know that it has been installed.
[root@xxx /]# python3
Python 3.6.8 (default, Apr 16 2020, 01:36:27)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
After installation, you can use the pip3
command to install the required packages.
I'm installing version 1 of aws-cli with the following command:
[root@xxx /]# pip3 install awscli
--AWS official website https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/developerguide/docker-basics.html --Install pip and awscli on CentOS7 https://rriifftt.hatenablog.com/entry/2015/10/28/142043
Recommended Posts