Skip to content

docker run -v Warnings#3

Open
donaldmurf wants to merge 4 commits intocmu-sei:mainfrom
donaldmurf:WARNINGS
Open

docker run -v Warnings#3
donaldmurf wants to merge 4 commits intocmu-sei:mainfrom
donaldmurf:WARNINGS

Conversation

@donaldmurf
Copy link
Copy Markdown

I found 13 instances where "docker run --rm -v ${PWD}:/host" or something similar exist in the redemption project.

I put a [!WARNING] one line above all occurrences to make these easy to find.

I might be wrong, but I think mounting to /host in the redemption docker may cause some issues.

I'll demonstrate an example:
Lets say I have a report.xml file from cppchecker and I want to run alerts2input.py

I will run the command:
sudo docker run -it --rm -v ~/Downloads/myCode/:/host -w /host docker.cc.cert.org/redemption/prereq bash
Screenshot from 2024-06-12 15-51-29
As you can see from the above picture, it's not possible to go to /host/code/analysis/alerts2input.py because the /host directory is replaced with the myCode directory.

@donaldmurf donaldmurf changed the title Warnings docker run -v Warnings Jun 19, 2024
@sei-dsvoboda
Copy link
Copy Markdown
Contributor

My plan has always been that inside the container, /host always contains the Redemption code, and the code you repair lives somewhere else, such as /data. This is useful when we develop Redemption, we share the Redemption code between host and container, so we can edit code on the host and run on the container. It is necessary if you use the 'prereq' or 'test' containers, which does not contain the Redemption code. However, sharing /host is less valuable if you are not developing the Redemption code. I will make this more explicit in the top-level README file.

Thanks for marking up the other 'docker run' commands. I will verify that they are consistent with the README file instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants