Skip to content

Commit

Permalink
feat(docker): support Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pplmx committed Sep 18, 2022
1 parent 6038a3b commit bb70f8f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
7 changes: 7 additions & 0 deletions template/cxx/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# all start with .(dot), including directories and files
.*
cargo-generate.toml
CHANGELOG.md
LICENSE*
docker-compose.yml
README.md
27 changes: 25 additions & 2 deletions template/cxx/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
FROM rockylinux
LABEL MAINTAINER="Mystic"
# BUILDING
FROM rockylinux:9 AS builder
LABEL author="Mystic"
WORKDIR /app

# build deps
RUN dnf upgrade --refresh -y && \
dnf install -y \
cmake \
gcc \
gcc-c++ \
make && \
dnf clean all

COPY . .

WORKDIR ./build
RUN cmake .. && cmake --build . --target {{project-name}} --config Release --parallel 8

# DEPLOYING
FROM scratch

WORKDIR /

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

ENTRYPOINT ["/{{project-name}}"]

0 comments on commit bb70f8f

Please sign in to comment.