Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arnemertz/docker4c
Docker container with compilers and tooling for basic C++ projects
https://github.com/arnemertz/docker4c
cpp docker
Last synced: about 10 hours ago
JSON representation
Docker container with compilers and tooling for basic C++ projects
- Host: GitHub
- URL: https://github.com/arnemertz/docker4c
- Owner: arnemertz
- Created: 2021-05-21T09:03:40.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-26T16:50:59.000Z (over 3 years ago)
- Last Synced: 2023-08-04T09:11:13.338Z (over 1 year ago)
- Topics: cpp, docker
- Language: Dockerfile
- Homepage:
- Size: 15.6 KB
- Stars: 76
- Watchers: 9
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
:bangbang: Very much work in progress!
# The container
The Dockerfile contains two container definitions:
- a CI container which should contain everything necessary to build C++ applications and run their tests
- a DEV container which inherits the CI container and adds debugging tools like Valgrind, gdb, etc.The compose file contains a basic setup to run the DEV container locally. Since some IDEs depend on an SSH connection to a container (or for remote development in general), SSHD is started in the service defined by the compose file.
The user for the Docker container is `dev`.
The compose file maps `~/git` on the host machine to `/home/dev/git` in the container, so I suggest that you check out your project there.# Scripts
The scripts directory has a few helpers for easier building and running of the container and executing commands in it. Consider adding the scripts directory to your path for ease of use.
## Building the container image
`docker4c build` (re)builds and tags the container image
## Starting
`docker4c up` starts the container in the background
## Stopping
`docker4c down` stops the running container
## Entering the container/Running commands
- Via ssh: `ssh dev@localhost -p 2222` , password is `dev`
- Via docker exec: `docker4c run`
- without commands: logs into the container via bash
- with commands: executes the given commands in the container`docker4c run` starts the container if it is not active yet and changes to the working directory it is called from if it exists inside the container (including `${HOME}` -> `/home/dev` mapping)