2

This page works as expected if I choose Ubuntu 14.04 image.

https://docs.docker.com/engine/installation/cloud/cloud-ex-aws/

But If I choose Amazon Linux AMI, (the first one in the list shown in the image) then I am not able to install 1.12 version of docker.

I can however install older version using ...

yum install docker 

But I am trying to install the latest 1.12 version on Amazon Linux AMI. Any suggestion will be appreciated.

shantanuo
  • 31,689
  • 78
  • 245
  • 403

6 Answers6

4

I managed to get Docker 1.12.2 running on Amazon Linux. Here are the steps I took:

Download the version of Docker you want to your Amazon Linux instance (as a gzipped tar), and extract it. This creates a directory called docker/ containing Docker binaries.

wget https://get.docker.com/builds/Linux/x86_64/docker-1.12.2.tgz
tar -xvzf docker-1.12.2.tgz

Move all the Docker binaries into /usr/local/bin.

sudo mv docker/* /usr/local/bin/

You need to run a script called cgroupfs-mount (as superuser) before starting up the Docker daemon. The easiest way to get this script is by cloning the git repo containing it.

git clone https://github.com/tianon/cgroupfs-mount
sudo mv cgroupfs-mount/cgroupfs-mount /usr/local/bin/

Change to the superuser and make sure that /usr/local/bin/ is in your path (on Amazon Linux at least this is not the case by default).

sudo su
export PATH=/usr/local/bin:$PATH

Now you can run the cgroupfs-mount script and start the Docker daemon (as a background process).

cgroupfs-mount
dockerd &

You can call regular Docker commands (e.g. docker pull) as any user who belongs to the docker group, while dockerd is running. Missing from these installation steps is having cgroupfs-mount and dockerd be automatically run at start up time.

As an aside, I would recommend avoiding Amazon Linux if at all possible and using a mainstream distro like Ubuntu or CentOS instead, which seem to have much better support for Docker.

James Hiew
  • 6,040
  • 5
  • 27
  • 41
4

Update: January 2017

Amazon offer docker 1.12 in repository of updates (amzn-updates).

I have installed docker-1.12.6-1.17.amzn1.x86_64

2

As of mid-October 2016, this is not possible: https://github.com/docker/docker/issues/27313

Long story short, it appears that there needs to be some coordination between the AWS & Docker folks and that coordination hasn't happened yet: https://github.com/docker/docker/pull/17283#issuecomment-163456402

Couple options:

  1. Wait until that process completes and a new AWS Linux AMI is released where when you could just run $ sudo yum install -y docker and be more or less up & running w/ 1.12

  2. Select a different AMI which will require additional installation/config depending on your requirements

ex. You mentioned you tried the Ubuntu 14.04 AMI. If you SSH'd to that instance & tried to copy some large files from S3 and unzip them on the host machine in order to mount them as volumes into your containers, you'd have a problem. The Ubuntu 14.04 AMI doesn't have the aws-cli tool installed nor the "unzip" command out of the box (nor docker for that matter)-- so you'd need to read over http://docs.aws.amazon.com/cli/latest/userguide/installing.html#install-bundle-other-os and run $ sudo apt-get unzip in order to get up and running. The AWS Linux AMI has a lot more bells & whistles out of the box. If you don't mind the config work and using a slightly different repository system, this isn't a bad option in the meantime.)

Victor
  • 868
  • 1
  • 9
  • 24
1

I don't know why your manual steps don't work but you can install the docker daemon using docker-machine.

VM_OPTS="--driver amazonec2 
--amazonec2-ami $YOUR-AMI
--amazonec2-instance-type t2.medium
--amazonec2-access-key $AWS_ACCESS_KEY_ID
--amazonec2-secret-key $AWS_SECRET_ACCESS_KEY
--amazonec2-ssh-keypath $AWS_SSH_KEYPATH
--amazonec2-region ap-southeast-2
--amazonec2-zone a
--amazonec2-security-group $YOUR_SEC_GROUP_NAME"

docker-machine create $VM_OPTS $VM_NAME
Bernard
  • 16,149
  • 12
  • 63
  • 66
0

You can also install it from the command line of the instance using the following:

curl -sSL https://get.docker.com/ | sh
Mano Marks
  • 8,761
  • 3
  • 27
  • 28
  • 2
    On Amazon Linux instances the command above runs 'yum -y -q install docker', which is essentially the same command as the original question. This command installs 1.11.2 (at this time). – dlaidlaw Oct 09 '16 at 18:36
0

(like in How to upgrade docker in latest Amazon linux AMI )

https://docs.docker.com/samples/library/amazonlinux/ The latest Amazon Linux 2017.09 seems to have Docker version 17.06.2-ce

Pau Ruŀlan Ferragut
  • 7,536
  • 2
  • 12
  • 5