From 3f64cc1377b57987f03779d8cb24d2f768941fa8 Mon Sep 17 00:00:00 2001 From: Leonardo Lima Date: Fri, 13 Nov 2020 11:34:12 -0300 Subject: [PATCH] Bundling the commands and removing the text duplication Co-authored-by: Lars Melchior --- README.md | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 6764e11..3e88aae 100644 --- a/README.md +++ b/README.md @@ -140,42 +140,38 @@ Ccache can be enabled by configuring with `-DUSE_CCACHE=`. ## Docker -The project has support to Docker, that allows building and running tests inside a container. -This container builds all targets, so you can run any of them passing a command after `sh -c`. +The project supports [Docker](https://www.docker.com) out-of-the-box, which allows building and running the project inside a container. +The container builds all targets, so you can run any of them passing a command after `sh -c`. + +### Docker Workflow ```bash +# build docker build . -t modern-cpp-starter - +# run tests +docker run modern-cpp-starter sh -c "./build/test/GreeterTests" +# run standalone docker run modern-cpp-starter ``` -Running tests. - -```bash -docker build . -t modern-cpp-starter - -docker run modern-cpp-starter sh -c "./build/test/GreeterTests" -``` - -The docker-compose can be used to manage a multi-container applications. Since this container builds all targets, you can build any specific targer passing its name after "sh -c". - -Running all containers. +### Docker Compose Workflow ```bash +# build docker-compose up --build -``` - -Running only your project. - -```bash +# run tests +docker-compose run application sh -c "./build/test/GreeterTests" +# run standalone docker-compose run application ``` -Runing tests. +### Removing Docker Support -```bash -docker-compose run application sh -c "./build/test/GreeterTests" -``` +Docker support is optional, if you don't need it simply remove the following files from the starter: + +- `.github/workflows/docker.yml` +- `Dockerfile` +- `docker-compose.yml` ## FAQ