Docker Community Forums

Share and learn in the Docker community.

Bundle python in the ami for devops capability

Expected behavior

When I ssh into a manager node and run ‘python --version’ it shows me the version of python installed.

Actual behavior

Python is not found

Additional Information

Docker version 1.13.0-rc4
OS info: Linux c458eb95f676 4.9.0-moby #1 SMP Fri Dec 16 04:28:53 UTC 2016 x86_64 Linux

We already use Ansible with AWS EC2 to control our server and application availability.
Having spun up a ‘Docker for AWS’ cluster we’re unable to connect to the manager nodes using Ansible as python is not installed/available in the ssh session.
It actually looks like the ssh session is inside a container itself as none of the usual package managers seem to be available.
Is there an easy way to get access to or make python available?
Thanks, pete

Steps to reproduce the behavior

  1. ssh into a manager node
  2. run ‘python --version’

Can’t you just run ansible or python in a container on Docker for AWS? You can mount the manager Docker engine API in that container. That will give whatever is running in the container full control of the Docker for AWS swarm install:

docker run -ti -v /var/run/docker.sock:/var/run/docker.sock ansible/ansible bash

(or you can run python instead of ansible/ansible)

This thread has more details: