AWX 19 : Create a custom awx-ee docker image

AWX 19 : Create a custom awx-ee docker image

Nov 17, 2021·

2 min read

If you have upgraded to awx 19 you may need to execute your jobs with specific awx-ee image. In this article we will go through the steps of building this custom image with ansible-builder.

what you need:

  • A docker environnement

  • python3

  • An Image Registry (dockerhub for example)

  • AWX on k8s (microk8s or minikube)

Ansible-builder install and config

Create a clean python virtual environment:

#Install pip if not present 
sudo apt install python3-pip
mkdir ~/ansible-builder && cd ~/ansible-builder
python3 -m venv builder
source builder/bin/activate

Install the components:

pip install wheel
pip install ansible
pip install ansible-builder

Create the config execution-environment.yml :

version: 1
  galaxy: requirements.yml
  python: requirements.txt
  system: bindep.txt

    - RUN alternatives --set python /usr/bin/python3
    - COPY /usr/bin/receptor /usr/bin/receptor
    - RUN mkdir -p /var/run/receptor
    - ADD /
    - CMD /
    - USER 1000 
    - RUN git lfs install

Create the requirements.yml and add the ansible collections that you need :

  - community.general

Create the requirements.txt and add the python packages that you need:


Create the bindep.txt file

python38-devel [platform:rpm compile]
subversion [platform:rpm]
subversion [platform:dpkg]
git-lfs [platform:rpm]

Create the context/ script :

#! /bin/bash
ansible-runner worker --private-data-dir=/runner

Add the execution rights to the script :

chmod +x context/

Build the EE Image

ansible-builder build --tag cisel/awx-ee:latest --context ./context --container-runtime docker


We should now have a container image:

docker images | grep awx-ee

cisel/awx-ee   latest    94cb5bb21c61   13 minutes ago   701MB

Push this to the registry (here is dockerhub), you will need access to your regitry before (docker login):

docker push cisel/awx-ee:latest

Setting Up AWX Environment

On AWX you can now add a custom Execution Environment : image.png

And define the custom image. On our example, we have save our docker image on Dockerhub :


And for the last step, you can configure the Execution Environment on the AWX templates where you need a custom image by selecting the newly created environment :


Feel free to comment this article if you have questions.