2023-07-16 06:05:41 +08:00
|
|
|
#### Building (example)
|
2023-07-16 09:06:32 +08:00
|
|
|
FROM setup-cpp-ubuntu AS builder
|
2021-09-19 01:05:52 +08:00
|
|
|
|
2023-01-19 22:02:27 +08:00
|
|
|
COPY ./dev/cpp_vcpkg_project /home/app
|
2022-04-27 13:33:36 +08:00
|
|
|
WORKDIR /home/app
|
2022-05-13 10:10:55 +08:00
|
|
|
RUN bash -c 'source ~/.cpprc \
|
2022-05-15 18:53:26 +08:00
|
|
|
&& task build'
|
2022-04-27 13:33:36 +08:00
|
|
|
|
2023-07-16 09:06:32 +08:00
|
|
|
#### Running environment
|
|
|
|
# use a fresh image as the runner
|
|
|
|
FROM ubuntu:22.04 as runner
|
2023-01-19 22:02:27 +08:00
|
|
|
|
2022-04-27 13:33:36 +08:00
|
|
|
# copy the built binaries and their runtime dependencies
|
|
|
|
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
|
|
|
|
WORKDIR /home/app/
|
|
|
|
ENTRYPOINT ["./my_exe"]
|
2023-07-20 05:31:19 +08:00
|
|
|
|
|
|
|
#### Cross Building (example)
|
|
|
|
FROM setup-cpp-ubuntu-mingw AS builder-mingw
|
|
|
|
|
|
|
|
COPY ./dev/cpp_vcpkg_project /home/app
|
|
|
|
WORKDIR /home/app
|
|
|
|
RUN bash -c 'source ~/.cpprc \
|
|
|
|
&& task build_cross_mingw'
|