Skip to content

Commit 8f9841a

Browse files
committed
feat: add debian docker file
1 parent 144817e commit 8f9841a

File tree

7 files changed

+43
-28
lines changed

7 files changed

+43
-28
lines changed

README.md

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,47 +40,50 @@ Tip: You can automate downloading using `wget`, `curl` or other similar tools.
4040

4141
### Executable
4242

43-
Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v0.1.1), and run it with the available options.
43+
Download the executable for your platform from [here](https://github.com/aminya/setup-cpp/releases/tag/v0.2), and run it with the available options.
4444

45-
An example that installs llvm, cmake, ninja, ccache, and conan.
45+
An example that installs llvm, cmake, ninja, ccache, and conan:
4646

4747
```ps1
4848
# windows example (open shell as admin)
49-
curl -O "https://github.com/aminya/setup-cpp/releases/download/v0.1.1/setup_cpp_windows.exe"
50-
./setup_cpp_windows --compiler llvm --cmake true --ninja true --ccache true --conan "1.40.1"
49+
curl -O "https://github.com/aminya/setup-cpp/releases/download/v0.2/setup_cpp_windows.exe"
50+
./setup_cpp_windows --compiler llvm --cmake true --ninja true --ccache true --conan true
5151
```
5252

5353
```ps1
5454
# linux example
55-
wget "https://github.com/aminya/setup-cpp/releases/download/v0.1.1/setup_cpp_linux"
55+
wget "https://github.com/aminya/setup-cpp/releases/download/v0.2/setup_cpp_linux"
5656
chmod +x setup_cpp_linux
57-
sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --conan "1.40.1"
57+
sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --conan true
5858
```
5959

6060
```ps1
6161
# mac example
62-
wget "https://github.com/aminya/setup-cpp/releases/download/v0.1.1/setup_mac_linux"
62+
wget "https://github.com/aminya/setup-cpp/releases/download/v0.2/setup_mac_linux"
6363
chmod +x setup_cpp_mac
64-
sudo ./setup_cpp_mac --compiler llvm --cmake true --ninja true --ccache true --conan "1.40.1"
64+
sudo ./setup_cpp_mac --compiler llvm --cmake true --ninja true --ccache true --conan true
6565
```
6666

67+
NOTE: In the `compiler` entry, you can specify the version after `-` like `llvm-11`.
68+
For the tools, instead of `true`, which chooses the default version, you can pass a specific version.
69+
6770
### With Nodejs
6871

69-
Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.1.1/setup_cpp.js), and run it with the available options.
72+
Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.2/setup_cpp.js), and run it with the available options.
7073

7174
On Windows
7275

7376
```ps1
7477
# open shell as admin
75-
wget "https://github.com/aminya/setup-cpp/releases/download/v0.1.1/setup_cpp_windows.exe"
76-
node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan "1.40.1"
78+
wget "https://github.com/aminya/setup-cpp/releases/download/v0.2/setup_cpp_windows.exe"
79+
node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true
7780
```
7881

7982
On Linux or Mac:
8083

8184
```ps1
82-
wget "https://github.com/aminya/setup-cpp/releases/download/v0.1.1/setup_cpp.js"
83-
sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan "1.40.1"
85+
wget "https://github.com/aminya/setup-cpp/releases/download/v0.2/setup_cpp.js"
86+
sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true
8487
```
8588

8689
# Inside GitHub Actions
@@ -111,6 +114,7 @@ jobs:
111114
compiler:
112115
- llvm
113116
- gcc
117+
# you can specify the version after `-` like `llvm-11`.
114118
steps:
115119
- name: Setup Cpp
116120
uses: aminya/setup-cpp@v1
@@ -120,40 +124,39 @@ jobs:
120124
ninja: true
121125
conan: true
122126
cppcheck: true
123-
ccache: true
127+
ccache: true # instead of `true`, which chooses the default version, you can pass a specific version.
124128
# add any tool that you need here...
125129
```
126130

127-
In the `compiler` entry, you can specify the version after a `-`. For example, `llvm-11`.
128-
129-
For the tools, instead of `true`, which chooses the default version, you can pass a specific version.
130-
131131
# Inside Docker
132132

133133
Here is an example for using setup_cpp to make a builder image that has the cpp tools you need.
134134

135135
```dockerfile
136-
# debian with node installed
137-
FROM node:16
136+
# debian
137+
FROM debian:bullseye
138138

139-
# add setup_cpp.js
139+
# add setup_cpp
140140
WORKDIR "/"
141-
RUN wget "https://github.com/aminya/setup-cpp/releases/download/v0.1.1/setup_cpp.js"
141+
RUN wget "https://github.com/aminya/setup-cpp/releases/download/v0.2/setup_cpp_linux"
142+
RUN chmod +x ./setup_cpp_linux
142143

143144
# install llvm, cmake, ninja, ccache, and conan
144-
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true
145+
RUN ./setup_cpp --compiler llvm --cmake true --ninja true --ccache true --conan true
145146

146147
ENTRYPOINT [ "/bin/bash" ]
147148
```
148149

149150
See [this folder](https://github.com/aminya/setup-cpp/tree/master/building/docker), for some dockerfile examples.
150151

151-
If you want to build the ones included, then run (after `-f` use the docker file name):
152+
If you want to build the ones included, then run:
152153

153154
```ps1
154-
docker build -f ./building/docker/linux.dockerfile -t setup_cpp .
155+
docker build -f ./building/docker/debian.dockerfile -t setup_cpp .
155156
```
156157

158+
After `-f` use the docker file name.
159+
157160
### Incomplete
158161

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

building/docker/debian.dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# debian
2+
FROM debian:bullseye
3+
4+
# add setup_cpp
5+
WORKDIR "/"
6+
RUN wget "https://github.com/aminya/setup-cpp/releases/download/v0.2/setup_cpp_linux"
7+
RUN chmod +x ./setup_cpp_linux
8+
9+
# install llvm, cmake, ninja, ccache, and conan
10+
RUN ./setup_cpp --compiler llvm --cmake true --ninja true --ccache true --conan true
11+
12+
ENTRYPOINT [ "/bin/bash" ]

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"test.unit": "jest --runInBand",
1919
"test": "run-p test.format test.lint test.tsc test.unit",
2020
"pack.exe": "shx rm -rf ./dist/tsconfig.tsbuildinfo && node ./building/scripts/pack-exe.js",
21-
"build.docker": "pnpm build && docker build -f ./building/docker/linux.dockerfile -t setup_cpp .",
21+
"build.docker": "pnpm build && docker build -f ./building/docker/debian.dockerfile -t setup_cpp .",
2222
"start.docker": "docker run -t setup_cpp ."
2323
},
2424
"engines": {

0 commit comments

Comments
 (0)