Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grouville/valgrind_42
Dockerfile that includes Valgrind, Vim and Clang for corrections
https://github.com/grouville/valgrind_42
Last synced: 1 day ago
JSON representation
Dockerfile that includes Valgrind, Vim and Clang for corrections
- Host: GitHub
- URL: https://github.com/grouville/valgrind_42
- Owner: grouville
- Created: 2020-12-02T17:00:58.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-19T23:11:19.000Z (over 1 year ago)
- Last Synced: 2024-11-27T16:21:36.845Z (2 months ago)
- Language: Dockerfile
- Size: 6.84 KB
- Stars: 50
- Watchers: 3
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-42 - Valgrind 42
README
# valgrind_42
Dockerfile that includes Valgrind, Vim and Clang for correctionsThis Dockerfile will be very usefull when you want to use Valgrind. As you may have realized, Valgrind doesn't work on newer versions of Mac OS, that's why this Dockerfile exists.
**How to use this git ?**
> Prerequisite : Run the docker app present in your Mac (or MSC)
```bash
$ git clone https://github.com/grouville/valgrind_42.git
$ cd valgrind_42
# This command creates the image with the latest Ubuntu. You'll only have to run this command the first time !
$ docker build -t $(whoami)/valgrind .
# We need to go to the directory of the project we want inside the container
$ cd PATH_TO_PROJECT
# This command runs the container, with the content of the current folder in the /valgrind PATH inside the container
$ docker run -d -it -v `pwd`:/valgrind/ --name $USER-valgrind $(whoami)/valgrind
# Then, on another terminal/ window, you can run this command, which will connect a shell inside the container :
$ docker exec -it $USER-valgrind bash# You can check the status of the containers with this command (on your host machine) :
$ docker ps
> CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
> 2f41454ac0b9 home/valgrind "/bin/bash" 13 minutes ago Up 13 minutes eager_einstein```
**For graphical projects needing to open a window**
Please follow the next steps so that your docker image can open windows.
1. Launch XQuartz (software is already installed in 42's sessions)
2. Go to XQuartz > Preferences... > Security tab, and check the "Allow connections from network clients" option
3. Quit & restart XQuartz (to activate the setting)
4. Enable authorisation for localhost for X11 forwarding by entering in a shell (on the host not the docker image)
```bash
$ xhost + 127.0.0.1
```
5. In your docker image's shell (see paragraph above, after docker run ... & docker exec ...), run the command
```bash
$ export DISPLAY=host.docker.internal:0
```