Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion containers/repronim-reprostim/generate_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ generate() {
--run "bash -c 'b=\$(ls ${PSYCHOPY_VENV_BIN}/python3); echo -e \"#!/bin/sh\n\$b \\\"\\\$@\\\"\" >| /usr/local/bin/python3; chmod a+x /usr/local/bin/python3'" \
--entrypoint python3 \
--run "bash -c '$REPROSTIM_CAPTURE_BUILD'" \
--run "bash -c '$REPROSTIM_CAPTURE_CLEAN'"
--run "bash -c '$REPROSTIM_CAPTURE_CLEAN'" \
--run "chmod a+rX -R /opt"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There's a potential bug here. The variable $REPROSTIM_CAPTURE_CLEAN is inside single quotes, so it will not be expanded by the shell. The literal string $REPROSTIM_CAPTURE_CLEAN will be passed to bash -c inside the container, which is likely not what you intend. The same issue exists on the line above for $REPROSTIM_CAPTURE_BUILD.

As you noted in the PR description, it's good practice to merge multiple --run commands to reduce image layers. You can fix the variable expansion and merge the commands at the same time.

Suggested change
--run "bash -c '$REPROSTIM_CAPTURE_CLEAN'" \
--run "chmod a+rX -R /opt"
--run "${REPROSTIM_CAPTURE_CLEAN} && chmod a+rX -R /opt"

# --user=reproin \
}

Expand Down
Loading