/bin/sh: python: command not found

Posted on

Getting below error

(py3916-ans2139) ansible-builder build -f base_execution_enviroment.yml -t localhost/ee-custom-image:v0.2
Running command:
podman build -f context/Containerfile -t localhost/ee-custom-image:v0.2 context
...showing last 20 lines of output...
ID_LIKE="fedora"
VERSION_ID="8.9"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.9 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.9
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.9"
--> e6533b7ba5c
[3/3] STEP 11/27: Run python --version
/bin/sh: python: command not found
[2/3] STEP 1/14: FROM e7ded158c1089c7601dfddaf28c2f86f18842b276282f8e03051cb8fd0fe30c5 AS builder
[2/3] STEP 2/14: WORKDIR /build
Error: building at STEP "RUN python --version": while running runtime: exit status 127

An error occurred (rc=127), see output line(s) above for details.
(py3916-ans2139) ansible-builder build -f base_execution_enviroment.yml -t localhost/ee-custom-image:v0.2

for the below manifest file


Environment for Executing Playbooks

version: 3 # Sets the version of the ansible-builder definition

build_arg_defaults:
ANSIBLE_GALAXY_CLI_COLLECTION_OPTS: '--pre' # Ansible Galaxy CLI options, Here Verbosity is Given

dependencies:
python: requirements.python
system: bindep.system
python_interpreter:
package_system: "python3"
python_path: "/usr/bin/python3"

images:
base_image:
name: registry.redhat.io/ansible-automation-platform-23/ee-29-rhel8:latest

options:
package_manager_path : /usr/bin/microdnf

additional_build_files:
- src: ansible.cfg
dest: configs
additional_build_steps:
prepend_galaxy:
- ADD _build/configs/ansible.cfg /etc/ansible/ansible.cfg
prepend_final: |
RUN whoami
RUN cat /etc/os-release
Run python --version
Run ansible --version
Run pip3 list
append_final:
- RUN echo This is a post-install command!
- RUN ls -la /etc

Responses