Build sdl2 program in docker image with cmake, run locally in arch-based os.
-
Compile stuff in the docker container:
docker compose up --build
- This creates a
build-dir
directory, runscmake
to configure the build, then runsmake
to perform the build. - The compiled file will be in
./build-dir/SDL2Test
- This creates a
-
Run the compiled program locally:
./build-dir/SDL2Test
-
Enter the container to do stuff
docker compose run compiler bash
-
Clean up
build-dir
and build artifacts:sudo rm -rf build-dir
-
Clean up docker container and network:
docker compose down