Skip to content

Commit 144817e

Browse files
committed
docs: add readme about the docker images
1 parent b011d26 commit 144817e

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

README.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The package can be used locally or from CI services like GitHub Actions. Stay tu
3232

3333
# Usage
3434

35-
## From Terminal
35+
# From Terminal
3636

3737
You should download the exe file or the js file (if have Nodejs installed), and run it with the available options.
3838

@@ -83,7 +83,7 @@ wget "https://github.com/aminya/setup-cpp/releases/download/v0.1.1/setup_cpp.js"
8383
sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan "1.40.1"
8484
```
8585

86-
## Inside GitHub Actions
86+
# Inside GitHub Actions
8787

8888
Here is a complete cross-platform example that tests llvm and gcc. It also uses cmake, ninja, conan, cppcheck, and ccache.
8989

@@ -128,6 +128,32 @@ In the `compiler` entry, you can specify the version after a `-`. For example, `
128128

129129
For the tools, instead of `true`, which chooses the default version, you can pass a specific version.
130130

131+
# Inside Docker
132+
133+
Here is an example for using setup_cpp to make a builder image that has the cpp tools you need.
134+
135+
```dockerfile
136+
# debian with node installed
137+
FROM node:16
138+
139+
# add setup_cpp.js
140+
WORKDIR "/"
141+
RUN wget "https://github.com/aminya/setup-cpp/releases/download/v0.1.1/setup_cpp.js"
142+
143+
# install llvm, cmake, ninja, ccache, and conan
144+
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true
145+
146+
ENTRYPOINT [ "/bin/bash" ]
147+
```
148+
149+
See [this folder](https://github.com/aminya/setup-cpp/tree/master/building/docker), for some dockerfile examples.
150+
151+
If you want to build the ones included, then run (after `-f` use the docker file name):
152+
153+
```ps1
154+
docker build -f ./building/docker/linux.dockerfile -t setup_cpp .
155+
```
156+
131157
### Incomplete
132158

133159
- [ ] msvc. It is implemented, but has bugs. See [this issue](https://github.com/aminya/cpp/issues/1)

building/docker/linux.dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ WORKDIR "/"
88
# run installation
99
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true
1010

11-
ENTRYPOINT [ "/bin/sh" ]
11+
ENTRYPOINT [ "/bin/bash" ]

0 commit comments

Comments
 (0)