Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Using a base image with microdnf causes ansible-builder failure for dnf path #690

Closed
netopsengineer opened this issue Jul 1, 2024 · 1 comment
Labels
needs_triage New item that needs to be triaged

Comments

@netopsengineer
Copy link

Team,

The docs for ansible-dev-tools suggest creating a custom 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

I originally opened an issue on ansible-dev-tools and was referred here ansible/ansible-dev-tools#284 by @ssbarnea

@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Jul 1, 2024
@Shrews
Copy link
Contributor

Shrews commented Jul 2, 2024

Your modification of the execution-environment.yml file to resolve the issue is the proper way of dealing with this.

Because the package manager is used within the dynamically built Containerfile with a RUN instruction (for example, to install the user's selected version of Python), and we do not do any sort of probing of the selected container image itself, it is required that you define the package manager within the EE file. If the assemble script were the only place the package manager was used, we could programmatically figure out which one exists because it is run within the container.

As such, your original bug report to ansible-dev-tools is completely valid, and I'll be closing this one.

@Shrews Shrews closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_triage New item that needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants