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
![](https://www.linuxteacher.com/wp-content/uploads/2020/05/docker-1.png)
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.
![aws](https://www.linuxteacher.com/wp-content/uploads/2020/05/Screenshot-from-2020-05-31-09-26-13-1024x215.png)
Then SSH into the instance ssh -i "key.pem" ec2-user@public_ip_address
![ssh_instance](https://www.linuxteacher.com/wp-content/uploads/2020/05/image-1.png)
Then update the image for fresh repositories and packages with sudo yum update -y
.
![update](https://www.linuxteacher.com/wp-content/uploads/2020/05/Screenshot-from-2020-05-31-09-54-50.png)
Now install docker using sudo amazon-linux-extras install docker
![install](https://www.linuxteacher.com/wp-content/uploads/2020/05/Screenshot-from-2020-05-31-09-55-53.png)
Now append the ec2-user to access the docker service without acquiring the root permissions using sudo usermod -a -G docker ec2-user
.
![user_permission](https://www.linuxteacher.com/wp-content/uploads/2020/05/Screenshot-from-2020-05-31-09-59-26.png)
Now start the docker service using sudo service docker start
/ sudo systemctl start docker
![service_start](https://www.linuxteacher.com/wp-content/uploads/2020/05/Screenshot-from-2020-05-31-09-58-36.png)
Now check the status of the service using docker info
or docker ps
.
![docker_info](https://www.linuxteacher.com/wp-content/uploads/2020/05/Screenshot-from-2020-05-31-10-16-43.png)
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.
![docker_ps](https://www.linuxteacher.com/wp-content/uploads/2020/05/Screenshot-from-2020-05-31-10-28-00-1024x63.png)
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]