If you don't want/can't install VMWare Player & just want to GCC with Docker.
- Install Docker by grabbing it from the official site. Pick your OS:
- For Linux, follow this guide
- For macOS, see this guide
- For Windows (g-d forbid), see this guide
- Make sure
docker composeis installed too. It comes with Docker Desktop on Windows/macOS. On Linux, if it’s missing, get it from here.
- Clone this repo
- Put your
Cfiles in theinternalfolder in the repo. - (Optional): Alter the
.envfile in the repo’s root directory with:USERNAME=your_username PASSWORD=your_password
- Open a terminal in the repo directory and run:
docker compose up -dThis starts the container in the background.
- To work in the container, run:
docker exec -it openu bash- Now you’re in! Use the terminal like normal—your files from
internalare at/root.
Uni wants us to compile using -ansi -pedantic -Wall flags, e.g:
gcc -g -ansi -pedantic -Wall test.c -o test- The container’s named
openuand uses GCC an older version (5.4) that the Uni uses by default. You can change that in the Dockerfile. If you do decide to use an older version though - Note that installing packages throughaptmight not work (old repo URLs), so make sure the RUN directive for installing is commented. - Your
internal/${USERNAME}folder maps to/home/${USERNAME}inside the container. - Timezone’s set to Jerusalem.
- Check
gcc --versioninside to confirm it’s the version you want. - If you mess up, check the Docker docs/just rebuild the container with
docker compose up --build --force-recreate -d- To stop & remove the container, use
docker compose down(I'd recommend you check out Docker/Podman if you're unfamiliar with it)
Thanks to KfearO for pointing out Ubuntu/dev env versioning!