Skip to main content

Tharsis in Docker

If you wish to try out the Tharsis suite in Docker, there are currently two options available.

Have a question?

Check the FAQ to see if there's already an answer.

All-in-one Docker image​

The all-in-one Docker image is mainly targeted towards headless or CI/CD applications where a single Docker image becomes more practical.

Requirements​

The following tools are built right into the image:

note

Unlike the docker-compose image, the all-in-one does not include the Tharsis UI.

not for production use!

Tharsis all-in-one Docker image is only meant for testing and should not be used in production or be exposed to the internet.

Downloading the latest image​

The latest images are always available in our GitLab container registry.

Usage guide​

Run the image with docker
docker run --rm -d -p 8000:8000 -p 8080:8080 registry.gitlab.com/infor-cloud/martian-cloud/tharsis/tharsis-all-in-one-docker
Expand for explanation

Above command will run the latest all-in-one Docker image in the background and bind the API to port 8000 and Keycloak IDP to port 8080.

The Tharsis API is available at http://localhost:8000. Keycloak is available at http://localhost:8080.

When the image starts, a default admin user with username martian and password martian is created automatically. A token can be requested from Keycloak. For example. Once authenticated, the Tharsis CLI can be used to issue commands to the API.

What about Github actions?

Say less. Click here for an example.

Docker Compose​

The docker-compose is meant for users wishing to try out Tharsis and can be run with a simple command. It includes all the components necessary to create Terraform runs within Tharsis.

Requirements​

The docker-compose.yml defines the following services:

ServiceContainer namePurpose
postgrestharsis-dbA database for the Tharsis API
kc_postgreskeycloak-dbA database for Keycloak IDP
keycloaktharsis-idpAn IDP for authenticating with the Tharsis API
miniotharsis-storeAn object storage (like AWS S3) for the Tharsis API
minioconsoletharsis-mcConfigures minio or Tharsis API's object store
apitharsis-apiThe Tharsis API
uitharsis-uiThe Tharsis UI
not for production use!

Tharsis docker-compose should not be used in production or be exposed to the internet.

Usage guide​

Either clone the Tharsis API repository or download the contents of the docker-compose directory.

Cloning the Tharsis API repository and using docker-compose
git clone https://gitlab.com/infor-cloud/martian-cloud/tharsis/tharsis-api.git
cd tharsis-api/docker-compose # directory might be different!
[sudo] docker compose up -d # "-d" means start in the background.
[sudo] docker logs tharsis-api # Optionally, check for Tharsis API logs.
Expand for explanation

Above will begin pulling the latest images from the appropriate sources and start them up in the background. Once all the services have finished booting up, we can visit the UI at http://localhost:3000, which should immediately redirect us to Keycloak for authentication. Just like the all-in-one docker image, an admin user is already created with credentials martian.

what about the tharsis cli?

Consult the Tharsis CLI configure command for help on creating a new profile. Once done, the sso login subcommand will help us authenticate with Tharsis.

note

The Tharsis API may take some time starting up as it waits for other services to be in a functioning state.

Frequently asked questions (FAQ)​

Can I create Terraform runs with a local Docker Compose instance?​

Yes! The Docker Compose includes all the service dependencies for applying Terraform modules and managing states with Tharsis. The database will store all the resource information and Minio will store the objects (Terraform modules).