Documentation

Installation

Getting Ansible Container

Prerequisites:

Ansible Container relies upon supported container engines for building, running, and deploying your project. When you install Ansible Container, you must specify which engines you want your installation to support. Currently supported engines are:

Specify the engines you wish supported by listing them comma separated in square brackets as part of your pip install command. For example, if you intended to use Docker for local container development but deploy your project into Kubernetes, you would want to install the docker and k8s engines like so:

$ sudo pip install ansible-container[docker,k8s]

If you do not have root privileges, you’ll need to use a virtualenv to create a Python sandbox:

$ virtualenv venv
$ source venv/bin/activate
$ pip install ansible-container[docker,openshift]

You’ll need to run the activate script in each shell session prior to invoking ansible-container. See the virtualenv docs for details.

Running from Source

If you’d like to run the bleeding edge version of Ansible Container, you can obtain it from our Github repository.

Prerequisites:

Clone the repo:

$ git clone https://github.com/ansible/ansible-container.git

We recommend that you use a Python Virtualenv to sandbox your installation. See the virtualenv docs for instructions.

Then, again specifying in square-brackets the engines you wish installed, use pip to install the cloned code:

$ cd ansible-container
$ pip install -e .[docker,openshift]

If you run into the following error, you likely have an older version of setuptools installed:

Traceback (most recent call last):
  File "./setup.py", line 11, in <module>
    packages=find_packages(include='container.*'),
  TypeError: find_packages() got an unexpected keyword argument 'include'

Use the following to upgrade to the latest release, and then run the install command again:

$ pip install --upgrade setuptools

You may need to run the above command with sudo if you’re not using a virtualenv.