Skip to content

42BV/docker-openstack-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Build Statu Docker Stars Docker Pulls

Docker - OpenStack Client

Run the OpenStack clients in a Docker container.

Projects included

OpenStack Client is a command-line client for OpenStack that brings the command set for Compute, Identity, Image, Object Store and Block Storage APIs together in a single shell with a uniform command structure.

This is a client library for Heat built on the Heat orchestration API. It provides a Python API (the heatclient module) and a command-line tool (heat).


Requirements

Build

Modify and build the container image from source:

git clone https://github.com/42BV/docker-openstack-client.git
cd docker-openstack-client
docker build -t openstack-client:<tag> .

Pull

Supported tags and Dockerfile links

Download a ready for use container image:

docker pull 42bv/openstack-client:latest

Usage

Credentials

Create a clouds.yaml file. You can find this information the the Horizon dashboard. You can add mutiple clouds to this file.

clouds:
  <cloud>:
    auth:
      auth_url: "<url>"
      username: "<username>"
      password: "<password>"
      user_domain_name: "Default"
      project_domain_name: "Default"
      project_name: "<project>" # optional
    region_name: "<region>"
    identity_api_version: 3

Important

  • Make sure you set (-e) the OS_CLOUD variable with the name of your cloud.
  • Mount (-v) the directory containing clouds.yaml to /etc/openstack.

Run in Interactive Mode:

docker run -it --rm -v $PWD:/etc/openstack -e "OS_CLOUD=<cloud>" --name openstack-client 42bv/openstack-client:latest

Run in Detached Mode:

docker run -id --rm -v $PWD:/etc/openstack -e "OS_CLOUD=<cloud>" --name openstack-client 42bv/openstack-client:latest
docker exec openstack-client openstack <subcommand>

To see if you are connected to your cloud run:

configuration show

Heat Orchestration Templates

Heat Orchestration

Template Guide: https://docs.openstack.org/heat/latest/template_guide/index.html

Using templates to launch a stack:

  • Run openstack-client in "Detached Mode" as described above.
  • When referencing Heat Orchestration Templates, note that the workdir inside the container is /etc/openstack.
docker exec openstack-client openstack stack create -t /etc/openstack/<template.yaml> <stack_name>