Running in Docker¶
It is recommended to run LSO inside a Docker container, as this helps separate installed dependencies for your Ansible playbooks and other scripts from the rest of the host system. For this, it is not necessary to clone any repository. However, we recommend you prepare the following files:
requirements.txt- Python requirementsansible-galaxy-requirements.txt- Ansible roles and collections.env.develop,.env.test, etc… - Runtime variables for different environmentsDockerfile- For building your image, explained belowcompose.yaml- For deploying your Docker image, explained below
Building an image¶
To build your own Docker image, you can use the following example file:
Dockerfile
This will install:
- Any dependent system packages like
gccorlibc-dev, - the
orchestrator-lsopython package, - further Python dependencies as defined in a
requirements.txtfile, and - required Ansible roles and collections defined in
ansible-galaxy-requirements.yaml.
To build the image, run something along the lines of:
docker build -t my-special-lso:dev .
More documentation for building, tagging, and publishing Docker images is available at the getting started or Docker Build reference pages.
Deploying¶
Using Docker Compose, your newly built Docker image can be deployed using this example snippet:
compose.yaml
For more options, please refer to the Docker Compose docs.