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

rules_oci fails to build when appending an env value with :PATH #640

Open
blockjon opened this issue Jun 26, 2024 · 3 comments
Open

rules_oci fails to build when appending an env value with :PATH #640

blockjon opened this issue Jun 26, 2024 · 3 comments
Labels
need: information We need more information to identify the bug

Comments

@blockjon
Copy link

According to the docs, I should be able to add to the oci container's env like this:

env = {"PATH": "/additional_binaries:/ddsource/proj/cicd_tools:$PATH"},

However, when I try this, the image fails to build.

Is this a known problem, or, am I doing something wrong?

I am able to get around this problem - I copied all of the $PATH values that the container was using and then I hard coded them like this:

env = {"PATH": "/additional_binaries:/ddsource/proj/cicd_tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"},

It would be better if i could use the $PATH variable.

@blockjon
Copy link
Author

The error message I'm getting has this in it:

OCI Image //mysource/proj/cicd_tools:cicd_tools failed: (Exit 5): image_cicd_tools.sh failed: error executing OCIImage command (
from target //mysource/proj/cicd_tools:cicd_tools)

@thesayyn
Copy link
Collaborator

This should be working, see our tests here

env = {
"TEST": "VALUE=",
"TEST2": "=VALUE=",
"TEST3": "=VALUE",
"TEST4": "=V=VALUE",
# an env that includes previously set $TEST env with a leading `=`
"LEAD_WITH_REF": "=$TEST",
"JUST_EQUALS": "======$$$$",
"1": "VAL",
# referencing non-existent env vars is just empty string.
"REFS": "$1:${1}:${NONEXISTENT}",
},

It would help me a lot if you could provide a repro.

@thesayyn
Copy link
Collaborator

thesayyn commented Jul 8, 2024

Also what version of rules_oci is this?

@thesayyn thesayyn added the need: information We need more information to identify the bug label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need: information We need more information to identify the bug
Projects
None yet
Development

No branches or pull requests

2 participants