DevOps
Head Start with Docker Containers
If deploying software is hard, time-consuming, and requires resources from another team, then developers will often build everything into the existing application in order to avoid suffering the new deployment penalty.
― Karl Matthias, Docker: Up and Running

Installing Docker on Amazon Linux
Launch an Amazon Linux AMI with basic configurations. Wait until the launch is over and the initialization is done. I have launched the instance in a t2.Micro instance type for illustration purposes.

Then SSH into the instance ssh -i "key.pem" ec2-user@public_ip_address

Then update the image for fresh repositories and packages with sudo yum update -y
.

Now install docker using sudo amazon-linux-extras install docker

Now append the ec2-user to access the docker service without acquiring the root permissions using sudo usermod -a -G docker ec2-user
.

Now start the docker service using sudo service docker start
/ sudo systemctl start docker

Now check the status of the service using docker info
or docker ps
.

If you encounter any errors in the following output which can be Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
OR Client:
Debug Mode: false Server:
ERROR: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/info: dial unix /var/run/docker.sock: connect: permission denied
errors pretty printing info
Then reload the service using sudo service docker restart
/ sudo systemctl restart docker
. Then make sure the service is up and running!
If the whole installation process was successful the output of the docker ps
will be something similar to image shown below.

For more DevOps related articles click here
-
DevOps55 years ago
Saltstack Tutorial for beginners [2023]
-
DevOps55 years ago
How to build a Docker cron job Container easily [2023]
-
Linux55 years ago
mail Command in Linux/Unix with 10+ Examples [2023]
-
DevOps55 years ago
Docker ADD vs COPY vs VOLUME – [2023]
-
DevOps55 years ago
How to setup Pritunl VPN on AWS to Access Servers
-
Linux55 years ago
Grep Command In Unix/Linux with 25+ Examples [2023]
-
Linux55 years ago
How To setup Django with Postgres, Nginx, and Gunicorn on Ubuntu 20.04
-
Linux55 years ago
Find command in Unix/Linux with 30+ Examples [2023]