Step to Install Docker on Amazon Linux or CentOS Linux

Step by Step procedure to install Docker Engine on Linux

In this Docker Tutorials, we will explain to you the step to Install Docker on Amazon Linux or CentOS Linux.

Step to Install Docker on Amazon Linux or CentOS LinuxFor this Article, we will take the example of CentOS 7 64-bit Operating System for installing Docker-engine
Distribution and type doesn’t mater when you doing on kernel 3.1.0 or better/above.

  • Docker-engine is available on CentOS7 repository but it is an older version
  • Create a yum repository, so that you can install docker with yum command

Command to Clean yum cache

#This cleans up any cached packages in any enabled repository cache directory which are normally stored in /var/cache/yum

#Update all package which is already installed

Command to install docker-engine

Docker-engine will install with appropriate se-linux and security settings that are necessary for containers to work correctly in your environment.

This will create the link necessary for us to start our service

Command to start docker on amazon linux

Now you can see docker demon will be running

Command to check Docker version in Linux

Command to check/list docker image

Note: As per best practice, it is recommended to run docker service with non-root user as per security perspective

How to configure and run docker with the normal user or non-root user?

you will see file and docker.sock file.

Docker.sock file is the one we are able to connect to as a user, the docker.sock file which is own by user “root” and with group “docker”.

Here you can see docker group but there is no user associated with it.

Now, re-login to the server and run the same command:

Now, as a user1 (normal user) can connect to the docker daemon

Script to Install Docker on Amazon Linux

It is recommended to update your OS on ec2 box, So depending on Amazon Linux/ RHEL / Centos version as the yum packages are taken from amazon’s repository. So you must consider updating your OS to latest.

Refer Docker version metrics:

This is the end of Docker Tutorials, where you learn all the step to install Docker on Amazon Linux or Centos Linux and best practice.

Related Articles

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Adblock Detected

Please consider supporting us by disabling your ad blocker
%d bloggers like this: