I am able to build my own docker image by updating inventory file entries, but having issues when I tried to install following tools by adding these entries to awx/blob/devel/installer/roles/image_build/templates/Dockerfile.j2 file.
RUN dnf install -y jq
RUN dnf install -y wget
RUN dnf install -y gcc
Added these entries in different sections of the file and still no luck. I see other tools in “Install runtime requirements” and other sections, so not sure why the resulted awx-web image/container doesn’t have these installed. I don’t see any errors either during install process.
Also commented to run as root and that too didn’t work as I still see the user as ‘awx’ when I got shell into the awx-web container in my Kubernetes environment.
Be aware that there are TWO docker containers built by that Dockerfile! The first one is used to build python packages for use by the second. Somewhere around line 100 or so you will see a second “FROM” line. That’s the start of the build for the container that is actually pushed. Below that are a series of COPY commands pulling the venv and some other things from the first container.
Right, there are 2 FROM lines. I tried adding below statements under and outside as well after the 2nd ‘FROM’ image build.
RUN dnf install -y jq
RUN dnf install -y wget
I will check again, if not, will try your route mentioned above. I was trying to build by adding few extra tools to the main Dockerfile template but it doesn’t appear to be working.
I don’t think even which is going to work but, i remember gcc is part of the default dockerfile which is required to compile the code. Is there any specific error you are getting while building it. For me, it works simply by adding RUN commands in Dockerfile.j2.
Good to know that it’s working for you. I do see which command working for other software that’s in Install section. I don’t see any error or warning messages, the image building fails if I mention‘net stat’ command since it’s not in the yum or dnf repo.
Other than that I have not seen anything.
I will try to build another image manually by using the generated Dockefile and see if it works.
Not sure if the issue is related to below Anisble task in https://github.com/ansible/awx/blob/devel/installer/roles/image_build/tasks/main.yml or docker_image Ansible module as I manually built a awx-web image with the same Dockerfile that’s used by docker_image module and I do see jq, nano, wget, and lsof installed there when I ran docker exec commands. The tools are there in ‘yum list installed’ list as well.
I gave up on building my own image as our corporate network has so many restrictions to install pip, npm and other open source packages.
@ Nicolas G, I have created my own image by adding jq, wget off of base AWX image and pushed to our private registry.
What changes need to be made to Anisble playbook or inventory fiiles to use that image instead of the docker hub public AWX image?