Machine: No support for Amazon Linux

Created on 22 Feb 2016  路  18Comments  路  Source: docker/machine

docker-machine (running on OSX) attempt to create/register a previously manually installed docker-engine instance on AWS running amazon-linux-ami 2015.09 (latest) results in error "Error creating machine: Error detecting OS: OS type not recognized".

following shows the local output then the remote host docker version

bash-3.2$ docker-machine create --driver generic --generic-ip-address docker-testbed --generic-ssh-user=ec2-user docker-testbed
Running pre-create checks...
Creating machine...
(docker-testbed) No SSH key specified. Connecting to this machine now and in the future will require the ssh agent to contain the appropriate key.
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Error creating machine: Error detecting OS: OS type not recognized
bash-3.2$ docker-machine version
docker-machine version 0.6.0, build e27fb87
$ docker version
Client:
Version: 1.10.1
API version: 1.22
Go version: go1.5.3
Git commit: 9e83765
Built: Thu Feb 11 19:14:21 2016
OS/Arch: darwin/amd64

Server:
Version: 1.10.1
API version: 1.22
Go version: go1.5.3
Git commit: 9e83765
Built: Thu Feb 11 20:39:58 2016
OS/Arch: linux/amd64
bash-3.2$


https://aws.amazon.com/amazon-linux-ami/2015.09-release-notes/

remote docker-engine

$ docker version
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5/1.9.1
Built:
OS/Arch: linux/amd64

Server:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5/1.9.1
Built:
OS/Arch: linux/amd64

Most helpful comment

2 years later and this problem still persists.

All 18 comments

Yes, I don't think we recognize Amazon Linux today (what does /etc/os-release say on that instance?), but it might be possible to add it without too much trouble as another Red Hat provisioner.

$ cat /etc/os-release
NAME="Amazon Linux AMI"
VERSION="2015.09"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2015.09"
PRETTY_NAME="Amazon Linux AMI 2015.09"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2015.09:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

Yes, we don't recognize it today, but it could theoretically be added to the provisioners

Should I go submit an issue on provisioners, or you'll handle it?

I think changing the title of this issue should suffice. Thanks.

Please add support for amazon ami latest is

cat /etc/os-release
NAME="Amazon Linux AMI"
VERSION="2016.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2016.03"
PRETTY_NAME="Amazon Linux AMI 2016.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2016.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

+1 Can i help on this? currently blocking a work project.

It should be fairly straightforward, and we'd be happy to take a PR -- to implement support you'd just need to extend the RedHatProvisioner (creating a new AmazonProvisioner) to check for the presence of amzn and it will work. For instance, check out the CentOS provisioner, which is only about 25 lines. If AL doesn't require anything custom, it should be about that length as well.

@nathanleclaire I started it up, but got a little stuck, I see provision.NewRedHatProvisioner uses composition with provision.SystemdProvisioner , but afaik amazon linux uses initd ?

I've got a rough version of what you were saying though:

Edit: now with sign off
https://github.com/MaerF0x0/machine/commit/dc6151a6d2299a96daa1bb4a3baa7bdfefe43653

Ah, it doesn't use systemd? That complicates things. You'll still probably be able to use some of the RedHat-related logic (don't copy and paste it, but you might have to split out and embed a new YumProvisioner struct or equivalent to abstract the common code). You'll also have to figure out how the Docker daemon is configured on AL to know how to set DockerOptionsDir and DaemonOptionsFile -- I'm not sure how those should be set exactly.

Anything new with this? Few months out now.

A PR adding this support, actually tested against newest Amazon Linux AMI: https://github.com/docker/machine/pull/3609

2 years later and this problem still persists.

AWS Linux 2 uses systemd, should be straight forward now.

It's much easier to use Amazon Linux 2 that's optimized for ECS because it starts up faster than Ubuntu image and doesn't require any installation for docker to work correctly on AWS. As someone else said, it uses systemd which makes me think it'll be basically a question of copying CentOS or Redhat configs.

3 years later and the problem still persists. :-(

This project is now in maintenance mode.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moander picture moander  路  5Comments

diver-sity picture diver-sity  路  4Comments

masaeedu picture masaeedu  路  4Comments

hananeglit picture hananeglit  路  3Comments

florentvaldelievre picture florentvaldelievre  路  3Comments