docs: add readme about the docker images

This commit is contained in:
Amin Yahyaabadi 2021-09-18 11:50:18 -05:00
parent b011d26aa1
commit 144817e932
2 changed files with 29 additions and 3 deletions

View File

@ -32,7 +32,7 @@ The package can be used locally or from CI services like GitHub Actions. Stay tu
# Usage
## From Terminal
# From Terminal
You should download the exe file or the js file (if have Nodejs installed), and run it with the available options.
@ -83,7 +83,7 @@ wget "https://github.com/aminya/setup-cpp/releases/download/v0.1.1/setup_cpp.js"
sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan "1.40.1"
```
## Inside GitHub Actions
# Inside GitHub Actions
Here is a complete cross-platform example that tests llvm and gcc. It also uses cmake, ninja, conan, cppcheck, and ccache.
@ -128,6 +128,32 @@ In the `compiler` entry, you can specify the version after a `-`. For example, `
For the tools, instead of `true`, which chooses the default version, you can pass a specific version.
# Inside Docker
Here is an example for using setup_cpp to make a builder image that has the cpp tools you need.
```dockerfile
# debian with node installed
FROM node:16
# add setup_cpp.js
WORKDIR "/"
RUN wget "https://github.com/aminya/setup-cpp/releases/download/v0.1.1/setup_cpp.js"
# install llvm, cmake, ninja, ccache, and conan
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true
ENTRYPOINT [ "/bin/bash" ]
```
See [this folder](https://github.com/aminya/setup-cpp/tree/master/building/docker), for some dockerfile examples.
If you want to build the ones included, then run (after `-f` use the docker file name):
```ps1
docker build -f ./building/docker/linux.dockerfile -t setup_cpp .
```
### Incomplete
- [ ] msvc. It is implemented, but has bugs. See [this issue](https://github.com/aminya/cpp/issues/1)

View File

@ -8,4 +8,4 @@ WORKDIR "/"
# run installation
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true
ENTRYPOINT [ "/bin/sh" ]
ENTRYPOINT [ "/bin/bash" ]