Skip to content

Instantly share code, notes, and snippets.

@brianz
Last active July 7, 2023 07:32
Show Gist options
  • Save brianz/8458fc666f5156fdbbc2 to your computer and use it in GitHub Desktop.
Save brianz/8458fc666f5156fdbbc2 to your computer and use it in GitHub Desktop.
Install docker on Amazon Linux
#!/bin/bash
#
# steps taken verbatim from:
# http://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html#install_docker
#
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
# log out and log in to pickup the added group
# Also install some common sense stuff
sudo yum install -y git
sudo yum -y groupinstall "Development Tools"
@klausbadelt
Copy link

This is also described in the AWS ECS documentation but installs an outdated Docker.

@NishaKuppuswamy
Copy link

Hi,
How do I install an specific version of docker(say 1.9.1) in Amazon Linux

@gurukannappa
Copy link

gurukannappa commented Jun 12, 2018

@NishaKuppuswamy , @klausbadelt Docker version is dependent on Amazon RHEL Linux OS version as the yum packages are taken from amazon's repository. Please consider upgrading OS from 2016 to 2017 or latest.

List of supported docker version in the following link.

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-ami-versions.html

After booting Amazon Linux 2017.09 machine just do

yum install docker -y

good to go !!


you could try yum repolist all command see from where the packages are taken from.

@doertedev
Copy link

If you're running Amazon linux 2, just type # amazon-linux-extras install docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment