DEV Community

Ayrton
Ayrton

Posted on

Best Amazon EC2 for Docker servers in 7 shell lines

Hi

With the Amazon Linux 2 Centos based instance, here is the best initialisation to start with Docker !

Alt Text

sudo yum update -y && sudo yum install git -y
sudo amazon-linux-extras install docker -y
sudo service docker start
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose;
sudo docker network create web
Enter fullscreen mode Exit fullscreen mode

try
sudo docker run hello-world

In order:

  • Update centos repo
  • Install Git
  • Install Docker
  • Start docker
  • Download Docker-compose
  • relative link for docker-compose
  • Docker-compose executable
  • Create base network

Love ❀️

Top comments (0)