mirror of
https://github.com/TheLartians/ModernCppStarter.git
synced 2025-08-31 22:21:13 +02:00
Bundling the commands and removing the text duplication
Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
This commit is contained in:
parent
4b2e42b2a1
commit
3f64cc1377
1 changed files with 19 additions and 23 deletions
42
README.md
42
README.md
|
@ -140,42 +140,38 @@ Ccache can be enabled by configuring with `-DUSE_CCACHE=<ON | OFF>`.
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
The project has support to Docker, that allows building and running tests inside a container.
|
The project supports [Docker](https://www.docker.com) out-of-the-box, which allows building and running the project inside a container.
|
||||||
This container builds all targets, so you can run any of them passing a command after `sh -c`.
|
The container builds all targets, so you can run any of them passing a command after `sh -c`.
|
||||||
|
|
||||||
|
### Docker Workflow
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# build
|
||||||
docker build . -t modern-cpp-starter
|
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
|
docker run modern-cpp-starter
|
||||||
```
|
```
|
||||||
|
|
||||||
Running tests.
|
### Docker Compose Workflow
|
||||||
|
|
||||||
```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.
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# build
|
||||||
docker-compose up --build
|
docker-compose up --build
|
||||||
```
|
# run tests
|
||||||
|
docker-compose run application sh -c "./build/test/GreeterTests"
|
||||||
Running only your project.
|
# run standalone
|
||||||
|
|
||||||
```bash
|
|
||||||
docker-compose run application
|
docker-compose run application
|
||||||
```
|
```
|
||||||
|
|
||||||
Runing tests.
|
### Removing Docker Support
|
||||||
|
|
||||||
```bash
|
Docker support is optional, if you don't need it simply remove the following files from the starter:
|
||||||
docker-compose run application sh -c "./build/test/GreeterTests"
|
|
||||||
```
|
- `.github/workflows/docker.yml`
|
||||||
|
- `Dockerfile`
|
||||||
|
- `docker-compose.yml`
|
||||||
|
|
||||||
## FAQ
|
## FAQ
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue