-
Ensure Docker Is Installed
Use your preferred installation method (package manager, official installer, etc.). Verify Docker is operational:docker version
-
Install ansible-builder
Install ansible-builder from PyPI:pip install ansible-builder
-
Authenticate with the Base Image Registry
For pulling an EE base image, log in with the appropriate registry. For Red Hat’s container catalog, run:docker login registry.redhat.io
Replace
registry.redhat.iowith another registry address if using a different source for the base image.
Example Base Image
You can pull the minimal RHEL 9 Execution Environment base image from the Red Hat container catalog by running:
docker pull registry.redhat.io/ansible-automation-platform-25/ee-minimal-rhel9:latestThis image contains a minimal set of packages required to build an Ansible Execution Environment on Red Hat Enterprise Linux 9.
- requirements.txt: Python modules.
- requirements.yml: Ansible collections.
- execution-environment.yml: Points to the above dependencies and configures the build process.
Use ansible-builder. In the repository root, run:
ansible-builder build \
--file execution-environment.yml \
--tag my-ansible-ee:latest \
--container-runtime dockerReplace my-ansible-ee:latest with your preferred image name.
- Check local images:
docker images
- Test the Ansible version:
docker run --rm -it my-ansible-ee:latest ansible --version
Tag and push your built image to your chosen registry. For example, using Docker Hub:
docker tag my-ansible-ee:latest <REGISTRY>/<USERNAME>/<REPO>:latest
docker push <REGISTRY>/<USERNAME>/<REPO>:latestYou can substitute <REGISTRY>/<USERNAME>/<REPO> with your own values.