CI docker image with both pyton and terraform

In our company, we are using gitlab CE and I’m managing my own runner. It’s configured to use docker and is working fine.

In our pipeline, I need to be able to execute terraform from pyton so I’m using an appropriate module for that.
In order to be able to execute this in the pipeline, I need to have a docker image that has both python and terraform installed.
At the moment I’m using the default python 3.9 image. There is also a docker image that contains terraform. Is there a way I can configure this in the pipeline file so both of these are available in a single image?