CMake installed to the official gcc Docker image.
Images are tagged with gcc version first and CMake version second, so gcc8 with CMake 3.13.1 is tagged with 8-3.13.1:
These images are updated as changes to the Dockerfiles are made.
Additionally, images are tagged with a date stamp YYYYMMDD:
These images are built from tags in the source repo and are stable.
Here is a complete list of Docker tags.
For rapid development, bind mount your source and build directories to the container:
$ docker run \
--rm -it \
--user $(id --user):$(id --group) \
--mount type=bind,src=/path/to/source/dir,dst=/usr/src/<source_dir> \
--mount type=bind,src=/path/to/build/dir,dst=/usr/src/<build_dir> \
--workdir /usr/src/<build_dir> \
<image> \
<command>This will run the container, execute <command>, and exit the container.
Leave <command> blank to shell into the container.
When mounting code to the container, it is advisable to run the container with current system user ID. If the container is run as root, all files that the container touches in the source and build directories will be owned by root.
This can be prevented with docker run's --user option. On Ubuntu Linux, use:
--user $(id --user):$(id --group)or something similar.
- gcc's Docker Hub or gcc's Docker Store
- Four-part series on Docker for embedded developers.
- Strong introduction to Docker.
- Seems to ignore the permissions issue?
- C build environment in a Docker container.
- Custom image build from Dockerfile.
- User is hard-coded in Dockerfile.
- Debian build environment in a Docker container.
- Background info for C build environment link.
- Blog post on using gosu in a Dockerfile to set container permissions.
- The first comment provides an alternate solution:
docker run -ti \-v /etc/group:/etc/group:ro -v /etc/passwd:/etc/passwd:ro \-u $( id -u $USER ):$( id -g $USER ) \some-image:lastest bash
- The first comment provides an alternate solution:
- Random GitHub repo. Untested.
- Blog post using the nobody user's uid when launching the container.