For information about installing Docker on your particular operating system, see Get Docker on the Docker Docs website. If you're using Amazon Linux 2, follow these steps to install Docker: Update the installed packages and package cache on your instance. NVIDIA Docker Engine wrapper repository. View the Project on GitHub. Repository configuration. In order to setup the nvidia-docker repository for your distribution, follow the instructions below. If you feel something is missing or requires additional information, please let us know by filing a new issue. List of supported distributions. After doing your initial sudo yum update -y you can install docker with: sudo yum install -y docker Add the ec2-user to the docker group (to avoid the need to sudo when running docker commands): Note! Log out and back in for this change to take effect. Sudo usermod -a -G docker ec2-user Enable the service to start automatically after a reboot, then actually start the service itself. In this tutorial, we will use Amazon Linux to install docker. Amazon Linux/Amazon Linux2 is the Linux Operating System used in EC2 Instance. Step 1– Log to Linux EC2 Instance and update it. $ sudo yum update -y. Step 2– Install docker using Yum command $ sudo yum install docker -y. Step 3– Start Docker Service $ Service docker start. Sudo yum install docker; However, neither one of these comands work, as shown in the output below: [email protected] myuser# sudo amazon-linux-extras install docker sudo: amazon-linux-extras: command not found [email protected] myuser# yum install docker Loaded plugins: amazon-id, search-disabled-repos No package docker available.
Prerequisite for this:
- Launch an EC2 Linux Instance on AWS. For more details click here
- Connect to an instance using Putty.
Install Docker on the EC2 Instance
- Update the installed packages and package cache on your instance by running the below command:
sudo yum update -y ( On linux instance apt-get doesn’t work , so you have to use the yum tool)
2. [ec2-user ~]$ sudo yum install -y docker
Install Docker Mac
3. [ec2-user ~]$ sudo service docker start
Starting cgconfig service: [ OK ]
Starting docker: [ OK ]
4. Add the
ec2-user to the
docker group so you can execute Docker commands without using
[ec2-user ~]$ sudo usermod -a -G docker ec2-user
5. docker info
In some cases, you may need to reboot your instance to provide permissions for the
ec2-userto access the Docker daemon. Try rebooting your instance if you see the following error:
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Yum Install Docker Amazon Linux 2
Docker is installed successfully. Isn’t it very easy to install docker ?