Skip to content

ggabriel96/cpp-on-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cpp-on-docker

Basic utility Docker images for C++ development and CI

Available images

Publish on DockerHub

Usage

cd into your project and run:

docker run --rm -v $(pwd):/workspace/ -w /workspace/ ggabriel96/clang-format:latest <options> <files>

Where:

  • <options> are options to be passed to clang-format, e.g. --dry-run --verbose -Werror
  • <files> are the files to be checked or formatted, e.g. $(find . -name '*.hpp')

Conversely, if you want to get into the container, run:

docker run --rm -it -v $(pwd):/workspace/ -w /workspace/ --entrypoint sh ggabriel96/clang-format:latest

Note the -it flags and the --entrypoint option.

Finally, if you want to directly apply the formatting, use the -i flag of clang-format and don't forget to use the -u/--user option of docker run so you don't end up with files owned by root. E.g.:

docker run --rm -u $(id -u):$(id -g) -v $(pwd):/workspace/ -w /workspace/ ggabriel96/clang-format:latest -i --verbose $(find . -name '*.hpp')

Releases

No releases published

Packages

No packages published