Comments (3)
@AlanCoding example given in issue has a couple problems:
- #50 is not done, including the list of system dependencies causes a traceback, but will delay looking at that until the issue is closed
- looks like code can't handle the multiline string you are using in your example, it wants a
prepend
and/orappend
section
cat execution-environment.yml
---
version: 1
dependencies:
python: requirements.txt
additional_build_steps: |
RUN touch foo
ENV ELIJAH_VAR=elijah
ansible-builder build
requirements.txt
requirements.txt
Traceback (most recent call last):
File "/home/elijah/.cache/pypoetry/virtualenvs/ansible-builder-d47oRQeY-py3.8/bin/ansible-builder", line 11, in <module>
load_entry_point('ansible-builder', 'console_scripts', 'ansible-builder')()
File "/home/elijah/sfw/ansible/ansible-builder/ansible_builder/cli.py", line 20, in run
if action():
File "/home/elijah/sfw/ansible/ansible-builder/ansible_builder/main.py", line 57, in build
self.containerfile.prepare_prepended_steps()
File "/home/elijah/sfw/ansible/ansible-builder/ansible_builder/main.py", line 205, in prepare_prepended_steps
prepended_steps = additional_prepend_steps.get('prepend')
AttributeError: 'str' object has no attribute 'get'
looks like need to gracefully reject a additional_build_steps
section that is not a dictionary
put up a PR with possible error message enhancement
from ansible-builder.
now testing w/ proper syntax, and its working for me:
---
version: 1
dependencies:
python: requirements.txt
additional_build_steps:
prepend: |
ENV ELIJAH_VAR=elijah
building the image and then inspecting the environment shows my environment variable was set.
This is another case for our basic integration tests for when we get those added to the repo
from ansible-builder.
Sorry about the example, it has been a moving target. The syntax has evolved over time. You can still do:
---
version: 1
dependencies:
python: requirements.txt
system: bindep.txt
additional_build_steps:
prepend: |
ENV ELIJAH_VAR=elijah
And the last piece of #50 is integrating bindep.txt
from collections into the mix, which is the current item I'm trying to get cleared up and finished. If you do it this way, the bindep.txt
file next to your execution-environment.yml
file can list git as an rpm type dependency.
from ansible-builder.
Related Issues (20)
- unexpected error when getting available versions of collection... community.general HOT 6
- Support recent versions of setuptools HOT 1
- Error when building an EE without requirements.yml HOT 2
- requirements-parser breaks on 3.12+ default venvs HOT 3
- ansible-builder version 3 has broken compatibility with schema version 1 HOT 1
- Modifying ssh config of EE HOT 1
- Adding Galaxy requirements from private Git instance HOT 1
- Container Policy Fails on Schema Version 3
- Concerning mutil arch builds HOT 1
- v3 prepend_builder adds command after "pip install" HOT 1
- ERROR! Unexpected Exception, this is probably a bug: '/api/v3/plugin/ansible/content/published/collections/index/community/general/versions/' HOT 9
- Equivalent to podman build --pull? HOT 2
- Add support for pip specifier syntax like `pywinrm[credssp]==0.4.3` HOT 2
- ansible-builder failing during galaxy steps HOT 1
- Building the image with Docker Engine 27+ gives some warnings
- Ansible builder fails after upgrade to 3.1.0 HOT 9
- BUG: Using a base image with microdnf causes ansible-builder failure for dnf path HOT 1
- Docs: Recommend using a RHEL image
- Ansible Galaxy check script error message may be somewhat misleading HOT 1
- Feature request: being able to add constraints for dependencies of ansible-core/ansible-runner/..., or to pin their dependencies HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-builder.