Skip to content

Commit

Permalink
feat(docker): enable crb repo
Browse files Browse the repository at this point in the history
to install some necessary packages for building the static binary
  • Loading branch information
pplmx committed Sep 20, 2022
1 parent 491534c commit 3befc49
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions template/cxx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ WORKDIR /app

# build deps
RUN dnf upgrade --refresh -y && \
dnf install -y \
dnf --enablerepo=crb install -y \
cmake \
gcc \
gcc-c++ \
make && \
dnf clean all
make \
# enable repo crb to install the following packages for building static binary
libstdc++-static \
glibc-static && \
# due to this Dockerfile is a multi-stage, the following clean steps are redundant.
dnf clean all && \
rm -fr /var/cache/yum

COPY . .

Expand All @@ -20,6 +25,6 @@ RUN cmake .. && cmake --build . --target {{project-name}} --config Release --par
# DEPLOYING
FROM scratch

COPY --chmod=777 --from=builder /app/build/{{project-name}} /{{project-name}}
COPY --from=builder /app/build/{{project-name}} /{{project-name}}

CMD ["/{{project-name}}", "-"]
CMD ["/{{project-name}}"]

0 comments on commit 3befc49

Please sign in to comment.