# Build custom AWX image for production

**URL:** <https://forum.ansible.com/t/build-custom-awx-image-for-production/39155>\
**Category:** Get Help\
**Tags:** awx\
**Created:** [December 14, 2024, 11:44am UTC](https://forum.ansible.com/t/build-custom-awx-image-for-production/39155 "2024-12-14T11:44:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bpmb82](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bpmb82/32/6920_2.png) [@bpmb82](https://forum.ansible.com/u/bpmb82)\
**Post date:** [December 14, 2024, 11:44am UTC](https://forum.ansible.com/t/build-custom-awx-image-for-production/39155/1 "2024-12-14T11:44:52Z")

</div>

Hi there! I forked the AWX repo and added support for Bitbucket Cloud webhooks and credentials:

awx-plugins: [Added bitbucket\_cloud\_token to credential plugins by bpmb82 · Pull Request #70 · ansible/awx-plugins · GitHub](https://github.com/ansible/awx-plugins/pull/70)  
ansible-ui: [Add bitbucket cloud webhook support by bpmb82 · Pull Request #3076 · ansible/ansible-ui · GitHub](https://github.com/ansible/ansible-ui/pull/3076)  
awx: [Add support for bitbucket cloud webhook by bpmb82 · Pull Request #15699 · ansible/awx · GitHub](https://github.com/ansible/awx/pull/15699)

I would like to build a custom image that I can run in production. I ran this command:  
`make awx-kube-build`  
and it builds an image but throws errors about a missing `django-auth-ldap` module when I try to run it. I tried adding this in `requirements.txt` but it doesn’t appear to work.

I also changed `requirements-git.txt` to my repos and branches for awx-plugins and exported these 2 environment variables before issueing the `make` command:

```auto
export UI_GIT_REPO=https://github.com/bpmb82/ansible-ui.git
export UI_GIT_BRANCH=add_bitbucket_cloud_webhook_support

```

How can I build a production image based upon my changes?

---

<div class="post-metadata">

**Author:** ![Phil\_Duncan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/phil_duncan/32/7197_2.png) [@Phil\_Duncan](https://forum.ansible.com/u/Phil_Duncan)\
**Post date:** [January 27, 2025, 3:51am UTC](https://forum.ansible.com/t/build-custom-awx-image-for-production/39155/2 "2025-01-27T03:51:09Z")

</div>

> [@bpmb82](#):
>
> `export UI_GIT_REPO=`

try also updating the requirements.in file. Also depending on where in the build your respective packages are required, you may need to make an update to the **awx/tools/ansible/roles/dockerfile/templates/Dockerfile.j2** file to add respective system dependencies in order to get the make process to compile the awx-image build successfully.

For example I had an issue with a build for version: 24.6.1 recently, that was complaining about openssl version 3.0.7. I ended up commenting out that specific version and using just openssl, and my build completed successfully.

Phil

---

<div class="post-metadata">

**Author:** ![Andersson007](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/andersson007/32/89_2.png) [@Andersson007](https://forum.ansible.com/u/Andersson007)\
**Post date:** [January 27, 2025, 6:55am UTC](https://forum.ansible.com/t/build-custom-awx-image-for-production/39155/3 "2025-01-27T06:55:26Z")

</div>

@bpmb82 hello, check out the [Getting started with EE document](https://docs.ansible.com/ansible/devel/getting_started_ee/index.html).

---

<div class="post-metadata">

**Author:** ![bpmb82](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bpmb82/32/6920_2.png) [@bpmb82](https://forum.ansible.com/u/bpmb82)\
**Post date:** [January 27, 2025, 2:49pm UTC](https://forum.ansible.com/t/build-custom-awx-image-for-production/39155/5 "2025-01-27T14:49:33Z")

</div>

Much appreciated for all the suggestions here! I have been able to build a new image which also includes the django\_auth\_ldap module but the problem is that the UWSGI appears to not load the virtual environment correctly. If I login to the awx-web pod and activate the virtual env, I can easily import django\_auth\_ldap. I lost the logs I’m afraid but I’ll see if I can still get them. Basically, ‘production.py’ and ‘settings.py’ could not import django\_auth\_ldap (no such module).

Am I missing something?
