Skip to content

Commit 7698fea

Browse files
committed
test: add fedora docker file
1 parent dda085d commit 7698fea

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ jobs:
9292
- "ubuntu_node.dockerfile"
9393
- "ubuntu_20.04_node.dockerfile"
9494
- "arch_node.dockerfile"
95+
- "fedora_node.dockerfile"
9596
node:
9697
- 14
9798
pnpm:

dev/docker/arch_node.dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ RUN pacman-db-upgrade
77
# nodejs
88
RUN pacman -S --noconfirm --needed nodejs
99

10+
# curl for downloading setup-cpp
11+
RUN pacman -S --noconfirm --needed curl
12+
1013
# add setup_cpp.js
1114
COPY "./dist/" "/"
1215
WORKDIR "/"
1316

1417
# run installation
15-
RUN pacman -S --noconfirm --needed curl
1618
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
1719

1820
# clean up
1921
RUN pacman -Scc --noconfirm
20-
#RUN rm -rf /home/yay/.cache/*
2122
RUN rm -rf /tmp/*
2223

2324
CMD source ~/.cpprc

dev/docker/fedora_node.dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## base image
2+
FROM fedora as base
3+
4+
RUN dnf -y check-update
5+
6+
# nodejs
7+
RUN dnf -y install nodejs
8+
9+
# curl for downloading setup-cpp
10+
RUN dnf -y install curl
11+
12+
# add setup_cpp.js
13+
COPY "./dist/" "/"
14+
WORKDIR "/"
15+
16+
# run installation
17+
RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --cppcheck true --ccache true --vcpkg true --doxygen true --gcovr true --task true
18+
19+
# clean up
20+
RUN rm -rf /tmp/*
21+
22+
CMD source ~/.cpprc
23+
ENTRYPOINT [ "/bin/bash" ]
24+
25+
#### Building
26+
FROM base AS builder
27+
COPY ./dev/cpp_vcpkg_project /home/app
28+
WORKDIR /home/app
29+
RUN bash -c 'source ~/.cpprc \
30+
&& task build'
31+
32+
### Running environment
33+
# use a distroless image or ubuntu:22.04 if you wish
34+
FROM gcr.io/distroless/cc
35+
# copy the built binaries and their runtime dependencies
36+
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
37+
WORKDIR /home/app/
38+
ENTRYPOINT ["./my_exe"]

0 commit comments

Comments
 (0)