openstack cli in a docker container

If you need to access your openstack cluster but there is no option to install packages on a jumpbox host that can access the cluster (lack of internet access or privileges) an alternative is to build locally a docker image that includes openstack CLI utility. Assumption is that the jumpbox host has docker installed and user can load docker images and run docker containers.

Firstly prepare a Dockerfile (based off python docker official images in this example):

Build docker image and provide as an argument path to stackrc file that includes details on how to access the cluster (endpoint, passwords etc).

After build is finished save docker image to tarball:

Copy tarball to a destination machine which can access openstack cluster and load docker image:

Run the container – you’ll and try listing e.g. servers

Leave a Reply

Your email address will not be published.