2023-07-16 06:05:41 +08:00
|
|
|
#### Building (example)
|
2023-07-16 09:06:32 +08:00
|
|
|
FROM setup-cpp-fedora AS builder
|
|
|
|
|
2023-07-16 06:05:41 +08:00
|
|
|
COPY ./dev/cpp_vcpkg_project /home/app
|
|
|
|
WORKDIR /home/app
|
|
|
|
RUN bash -c 'source ~/.cpprc \
|
|
|
|
&& task build'
|
|
|
|
|
|
|
|
#### Running environment
|
2023-07-16 09:06:32 +08:00
|
|
|
# use a fresh image as the runner
|
|
|
|
FROM fedora:38 as runner
|
|
|
|
|
2023-07-16 06:05:41 +08:00
|
|
|
# copy the built binaries and their runtime dependencies
|
2023-07-16 09:06:32 +08:00
|
|
|
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
|
2023-07-16 06:05:41 +08:00
|
|
|
WORKDIR /home/app/
|
|
|
|
ENTRYPOINT ["./my_exe"]
|
2023-07-20 05:31:19 +08:00
|
|
|
|
|
|
|
#### Cross Building (example)
|
|
|
|
FROM setup-cpp-fedora-mingw AS builder-mingw
|
|
|
|
|
|
|
|
COPY ./dev/cpp_vcpkg_project /home/app
|
|
|
|
WORKDIR /home/app
|
|
|
|
RUN bash -c 'source ~/.cpprc \
|
|
|
|
&& task build_cross_mingw'
|