ansible / ansible-builder

An Ansible execution environment builder
Other
289 stars 93 forks source link

EE fails when using debian or ubuntu base image #636

Closed hrv-cta closed 9 months ago

hrv-cta commented 9 months ago

Hello,

I'm trying to create an EE with ubuntu or debian base image, and every time it fails because it doesn't find the ensurepip module. Below is my yml:

---
version: 3
dependencies:
  ansible_core:
    package_pip: ansible-core==2.15.6
  galaxy: requirements.yml
  python: requirements.txt
  ansible_runner:
    package_pip: ansible-runner
  # python_interpreter:
  #     package_system: "python311"
  #     python_path: "/usr/bin/python3.11"

images:
  base_image:
    # name: docker.io/redhat/ubi9:latest
    # name: quay.io/rockylinux/rockylinux:9
    # name: ubuntu:mantic
    name: debian:bookworm

# options:
#   package_manager_path: apt

additional_build_steps:
  prepend_base:
    - RUN apt update
    - RUN apt install -y python3

The error is:

#8 [base 4/7] RUN /usr/bin/python3 -m ensurepip
#8 0.229 /usr/bin/python3: No module named ensurepip
#8 ERROR: process "/bin/sh -c $PYCMD -m ensurepip" did not complete successfully: exit code: 1
------
 > [base 4/7] RUN /usr/bin/python3 -m ensurepip:
0.229 /usr/bin/python3: No module named ensurepip
------
Dockerfile:22
--------------------
  20 |     RUN apt update
  21 |     RUN apt install -y python3
  22 | >>> RUN $PYCMD -m ensurepip
  23 |     RUN $PYCMD -m pip install --no-cache-dir $ANSIBLE_INSTALL_REFS
  24 |     COPY _build/scripts/ /output/scripts/

Thanks!

Shrews commented 9 months ago

Not really a bug since builder is intentionally designed to work only with RHEL'ish images. There are plans, though, to consider allowing a wider range of distros. See https://github.com/ansible/ansible-builder/issues/553.