Hi, I would like to know if you could pinpoint me the exact way to make a software installed in the awx_task container, so when I run playbooks from AWX using the “delegate_to: localhost” it gets done successfully.
The Dockerfile for the awx-web container is at awx/devel/installer/roles/image_build/templates/Dockerfile.j2 and the Dockerfile for the awx-task container is at awx/devel/installer/roles/image_build/templates/Dockerfile.task.j2. If you take a look at the awx-task Dockerfile, you’ll see that all it’s doing is building off the awx-web Dockerfile and removing nginx and launching a different script. Anything the awx-web Dockerfile installs/executes as part of the image is also part of awx-task.
What I’ve been doing is I’ll modify the awx-web Dockerfile with RUN commands to install extra yum packages, pip modules, or ansible virtual envs using Ansible’s lineinfile/blockinfile. Ends up looking similar to below (installs extra yum packages)
But you said that the awx/devel/installer/roles/image_build/templates/Dockerfile.task.j2 is the Dockerfile, but in fact is a Jinja2 file…
I think you mean the file awx/installer/roles/image_build/tasks/main.yml is the one you have modified? Or which file have you modified?
Could you more in detail what have you written (or a very simple example) in both files? I apologize for this question, but I think it could clear out a lot of things to the ones that are facing this kind of problem.
And the snippet of Ansible code is exactly what I use to install additional yum packages. It’s editing the Dockerfiles to add lines that install yum packages. When the image finally gets built, those commands are run and the final image has those packages ready to go.