ansible / ansible-dev-tools

Ansible automation developer tools
https://ansible.readthedocs.io/projects/dev-tools/
GNU General Public License v3.0
51 stars 22 forks source link

BUG: Using this image as an EE docs lead to ansible-builder failure for dnf path #284

Closed netopsengineer closed 4 days ago

netopsengineer commented 2 weeks ago

Team,

The docs suggest creating an execution-environment.yml with the following:

---
version: 3

images:
  base_image:
    name: ghcr.io/ansible/community-ansible-dev-tools:latest

dependencies:
  galaxy: requirements.yml
  python: requirements.txt

However, this looks to create the following error during the build where ansible-builder is expecting to find /usr/bin/dnf, but it appears the image is using /usr/bin/microdnf instead:

3.069 /output/scripts/assemble: line 163: /usr/bin/dnf: No such file or directory
------
Dockerfile:57
--------------------
  55 |     COPY _build/requirements.txt requirements.txt
  56 |     RUN $PYCMD /output/scripts/introspect.py introspect --user-pip=requirements.txt --write-bindep=/tmp/src/bindep.txt --write-pip=/tmp/src/requirements.txt
  57 | >>> RUN /output/scripts/assemble
  58 |
  59 |     # Final build stage
--------------------
ERROR: failed to solve: process "/bin/sh -c /output/scripts/assemble" did not complete successfully: exit code: 127

Adding the following to the execution-environment.yml resolves it:

options:
  package_manager_path: /usr/bin/microdnf
ssbarnea commented 2 weeks ago

Please file a bug under builder project, it should support microdnf.

netopsengineer commented 1 week ago

Thanks @ssbarnea!

netopsengineer commented 1 week ago

@ssbarnea the ansible-builder team indicated this is in fact an issue on the ansible-dev-tools side, and the behavior with microdnf is expected and my fix is the way to do it.