Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Dockerfile that includes Valgrind, Vim and Clang for corrections

Notifications You must be signed in to change notification settings

mdabir1203/valgrind_42_Clion_ver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Reversing valgrind_42 Clion Version

Dockerfile that includes Valgrind, Vim and Clang for corrections + Clion as an IDE

Why ?

Clion is a professional IDE. It's easier to debug things rather setting it up in VS Code. Anyhow it is individual preference of what they want to have. This 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)

$ git clone https://github.com/mdabir1203/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)
$ xhost + 127.0.0.1
  1. In your docker image's shell (see paragraph above, after docker run ... & docker exec ...), run the command
$ export DISPLAY=host.docker.internal:0

Addition :

  1. Clion with path defined

#Acknowledgement Thanks to the original creator : ## grouville

About

Dockerfile that includes Valgrind, Vim and Clang for corrections

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 84.9%
  • Shell 15.1%