Skip to content

Commit c04f432

Browse files
committed
test: add examples for alpine docker
1 parent 24ed36b commit c04f432

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#### Building (example)
2+
FROM aminya/setup-cpp-alpine-gcc AS builder
3+
4+
COPY ./dev/cpp_vcpkg_project /home/app
5+
WORKDIR /home/app
6+
RUN task build
7+
8+
#### Running environment
9+
# use a fresh image as the runner
10+
FROM alpine:3.21 AS runner
11+
12+
# copy the built binaries and their runtime dependencies
13+
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
14+
WORKDIR /home/app/
15+
ENTRYPOINT ["./my_exe"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#### Building (example)
2+
FROM aminya/setup-cpp-alpine-llvm AS builder
3+
4+
COPY ./dev/cpp_vcpkg_project /home/app
5+
WORKDIR /home/app
6+
RUN task build
7+
8+
#### Running environment
9+
# use a fresh image as the runner
10+
FROM alpine:3.21 AS runner
11+
12+
# copy the built binaries and their runtime dependencies
13+
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
14+
WORKDIR /home/app/
15+
ENTRYPOINT ["./my_exe"]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#### Cross Building (example)
2+
FROM aminya/setup-cpp-alpine-mingw AS builder-mingw
3+
4+
COPY ./dev/cpp_vcpkg_project /home/app
5+
WORKDIR /home/app
6+
RUN bash -c 'source ~/.cpprc \
7+
&& task build_cross_mingw'

0 commit comments

Comments
 (0)