Allows you to test 42 projects in a linux environment and use valgrind to detect memory leaks.
- Install Docker on your machine
- You can configure shared paths from
Docker -> Preferences... -> Resources -> File Sharing
- Add path to expored directory
/goinfre/login42
- Clone the repo
git clone git@github.com:ricardoreves/42-run-project-in-docker.git
- Go to the directory
cd 42-run-project-in-docker
- Generate the image
42/ubuntu
withDockerfile
docker build -t 42/ubuntu .
- Create an alias
ftdocker
Open your ~/.zshrc
vim ~/.zshrc
Append the line below
alias ftdocker='docker run -it --rm -v $(pwd):/project 42/ubuntu'
Reload your ~/.zshrc
source ~/.zshrc
Open your ~/.bashrc
vim ~/.bashrc
Append the line below
alias ftdocker='docker run -it --rm -v $(pwd):/project 42/ubuntu'
Reload your ~/.bashrc
source ~/.bashrc
- Go to the project directory
cd path/to/the-project
- Run current project with image
42/ubuntu
ftdocker
- Quit docker bash
exit
List docker images
docker images
Delete docker image
docker image rm <image-id>
List docker containers
docker container ls
- codefresh.io - Build docker image with dockerfiles
- docs.docker.com - Docker Desktop for Mac user manual