Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
* Remove the second image and keep the builder as the base
* Increase the number of parallel jobs during compilation
* Remove the build dependencies after the installation
  • Loading branch information
Harvester57 committed Nov 25, 2021
1 parent 75073fd commit c4c1bdf
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Source: https://hub.docker.com/_/alpine/
FROM alpine:3.15.0 AS builder
FROM alpine:3.15.0

LABEL maintainer "florian.stosse@safrangroup.com"
LABEL lastupdate "23-11-2021"
LABEL author "Florian Stosse"
LABEL description "CppCheck v2.6, built using Alpine image v3.14.3"
LABEL description "CppCheck v2.6, built using Alpine image v3.15.0"
LABEL license "MIT license"

RUN \
Expand All @@ -14,15 +14,13 @@ RUN \
WORKDIR /usr/src

# Cf. https://github.com/danmar/cppcheck/releases
RUN git clone --branch 2.6 https://github.com/danmar/cppcheck.git --depth 1
RUN git clone --branch 2.6 https://github.com/danmar/cppcheck.git --depth 1

WORKDIR /usr/src/cppcheck

RUN \
make install FILESDIR=/cfg HAVE_RULES=yes CXXFLAGS="-O3 -DNDEBUG --static" -j2 && \
strip /usr/bin/cppcheck

FROM alpine:3.15.0
make install FILESDIR=/cfg HAVE_RULES=yes CXXFLAGS="-O3 -DNDEBUG --static" -j4 && \
strip /usr/bin/cppcheck && \
apk del .required_apks

COPY --from=builder /usr/bin/cppcheck /usr/bin/cppcheck
ENTRYPOINT ["cppcheck"]

0 comments on commit c4c1bdf

Please sign in to comment.