setup-cpp/dev/docker/ubuntu.dockerfile

24 lines
612 B
Plaintext
Raw Normal View History

#### Building (example)
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
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'
#### Running environment
# use a fresh image as the runner
FROM ubuntu:22.04 as runner
2023-01-19 22:02:27 +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"]
#### 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'