Conversation
Fixes MISP#265
|
I will need to investigate this more. How do you run podman to build the images? |
|
@cudeso have you tried using the SHELL variable for the whole build process (https://docs.docker.com/reference/dockerfile/#shell) ? |
|
@ostefano I've done each build with the same command, which basically resets the system to its original state.
|
|
That is weird though right? We would expect setting bash globally for the build to fix this. Since it's a multi step build, have you tried adding it just to the offending step? |
Indeed. Don't fully understand why the global setting doesn't fix it. |
| EOF | ||
|
|
||
| RUN <<-EOF | ||
| RUN bash <<'EOF' |
There was a problem hiding this comment.
@cudeso are quotes necessary here? My understanding is that they are not
There was a problem hiding this comment.
I initially also considered them optional, but removing them results in build error
4/5] STEP 19/19: RUN bash <<-EOF
bash: line 18: [: : integer expression expected
Skipping overwriting due to missing version variable
--> 518f13e9d985
--> 76e4f9f0a3dd
[5/5] STEP 11/23: RUN pip install --no-cache-dir /wheels/*.whl && rm -rf /wheels
WARNING: Requirement '/wheels/*.whl' looks like a filename, but the file does not exist
[notice] A new release of pip is available: 25.0.1 -> 25.1.1
[notice] To update, run: pip install --upgrade pip
ERROR: *.whl is not a valid wheel filename.
Error: building at STEP "RUN pip install --no-cache-dir /wheels/*.whl && rm -rf /wheels": while running runtime: exit status 1
Error: executing /usr/local/bin/podman-compose build --no-cache: exit status 1
There was a problem hiding this comment.
This is getting so random...
Do we know what was the shell expansion that did not work without this workaround?
Asking because we might need to retrofit this workaround to other build steps.
There was a problem hiding this comment.
Yes, basically the expansion did not work in the for loop (line 180 and further).
Printing out the variables PYPI_MODULE_NAME_VERSION before and after the the "for mod in" loop indicated they were set. But within the for loop they were empty.
In that for loop, it affected all PYPI_ variables.
There was a problem hiding this comment.
It is indeed very weird/random. Using bash, with escaping the EOF was eventually the only way I found working to get those variables retain their value.
There was a problem hiding this comment.
Not happy yet, trying to reproduce things locally. How are you building it? Are you using podman-compose?
Because if I do so via COMPOSE_PROGRESS=plain podman compose build misp-core, I get this:
Skipping overwriting redis due to missing version variable
Skipping overwriting lief due to missing version variable
Skipping overwriting pydeep2 due to missing version variable
Skipping overwriting python-magic due to missing version variable
Skipping overwriting misp-lib-stix2 due to missing version variable
Skipping overwriting maec due to missing version variable
Skipping overwriting mixbox due to missing version variable
Skipping overwriting cybox due to missing version variable
Skipping overwriting pymisp due to missing version variable
Skipping overwriting misp-stix due to missing version variable
Adding missing module setuptools with version '==80.3.1'
Adding missing module supervisor with version '==4.2.5'
There was a problem hiding this comment.
Same with podman-compose (skipping the compose provider selection)
|
As per chat, this will be converted into a doc update where we suggest the workaround to users relying on an old (pre 5) version of |
Added #285 |
Fixes #265
Solves variable expansion differences between Podman and Docker.