Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/42bv/docker-openstack-client

Run the OpenStack clients in a docker container
https://github.com/42bv/docker-openstack-client

dockerfile openstack openstack-clients openstack-heat python-heatclient python-openstackclient

Last synced: about 2 months ago
JSON representation

Run the OpenStack clients in a docker container

Awesome Lists containing this project

README

        

[![Docker Build Statu](https://img.shields.io/docker/build/42bv/openstack-client.svg)](https://hub.docker.com/r/42bv/openstack-client/builds/) ![Docker Stars](https://img.shields.io/docker/stars/42bv/openstack-client.svg) [![Docker Pulls](https://img.shields.io/docker/pulls/42bv/openstack-client.svg)](https://hub.docker.com/r/42bv/openstack-client/)

# [![Docker - OpenStack Client](https://raw.githubusercontent.com/42BV/docker-openstack-client/master/logo.png)](https://www.openstack.org)

Run the OpenStack clients in a Docker container.

## Projects included

### [python-openstackclient](https://github.com/openstack/python-openstackclient)
> 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.

### [python-heatclient](https://github.com/openstack/python-heatclient)
> 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

- [Docker](https://www.docker.com/community-edition)

## 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: .
```

## Pull

### Supported tags and Dockerfile links

- latest ([Dockerfile](https://github.com/42BV/docker-openstack-client/blob/master/Dockerfile))

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:
:
auth:
auth_url: ""
username: ""
password: ""
user_domain_name: "Default"
project_domain_name: "Default"
project_name: "" # optional
region_name: ""
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=" --name openstack-client 42bv/openstack-client:latest
```

### Run in Detached Mode:
```
docker run -id --rm -v $PWD:/etc/openstack -e "OS_CLOUD=" --name openstack-client 42bv/openstack-client:latest
docker exec openstack-client openstack
```

To see if you are connected to your cloud run:

```
configuration show
```

---

## Heat Orchestration Templates
![Heat Orchestration](https://raw.githubusercontent.com/42BV/docker-openstack-client/master/heat.png)

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/
```