This article uses Amazon Linux 2 on AWS to do the following:
First, update yum as follows.
[[email protected] ~]$ sudo yum update -y
Then install docker.
[[email protected] ~]$ sudo amazon-linux-extras install docker -y
After the installation is complete, start the docker daemon.
[[email protected] ~]$ 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```.
[[email protected] ~]$ 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)
[[email protected] ~]$ docker run -it centos ・ ・ ・ [[email protected] /]#
[[email protected] ~]$ yum install python3 -y
By entering the
python3 command as shown below, you can enter interactive mode and know that it has been installed.
[[email protected] /]# 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:
[[email protected] /]# 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