Giter Site home page Giter Site logo

cppcheck-docker's Introduction

cppcheck-docker

Introduction

Dockerfile to build latest and any tagged version of cppcheck.

Main aims:

  1. Ability to build the most recent version of cppcheck. With this Dockerfile you can build the lastest main and any tagged version.

  2. Make the result image as small as possible. This Dockerfile uses alpine linux and removes any unneeded file and strips the resulting cppcheck binary.

  3. Easy to use. Only need to mount a directory to /src to start check.

Usage

Available Multi-Arch Images

CI/CD will automatically build, test and push new images to container registries. Currently, the following registries are supported:

CLI

docker run -v $(pwd):/src neszt/cppcheck-docker

To allow Ctrl + C during cppcheck run use -t docker argument:

docker run -t -v $(pwd):/src neszt/cppcheck-docker

References

Cppcheck manual

Build your own image

Latest:

docker build -t cppcheck .

For Specific version use any tag from cppcheck tags

docker build --build-arg SOURCE_BRANCH=2.2 -t cppcheck .

cppcheck-docker's People

Contributors

neszt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cppcheck-docker's Issues

license?

Hey @neszt - I found this helpful - thanks.

You have a license for this? I'd like to leverage, but want to make sure I'm in the clear (ie, apache2, or MIT, or... )?

Build Failure

Cppcheck no longer builds under Alpine.

I get 2 errors:

cli/filelister.cpp: In function 'void addFiles2(std::map<std::__cxx11::basic_string<char>, long unsigned int>&, const string&, const std::set<std::__cxx11::basic_string<char> >&, bool, const PathMatch&)':
cli/filelister.cpp:205:86: error: 'NAME_MAX' was not declared in this scope
  205 |                 char buf[sizeof(*dir_result) + (sizeof(dir_result->d_name) > 1 ? 0 : NAME_MAX + 1)];
      |                                                                                      ^~~~~~~~
In file included from cli/filelister.cpp:23:
cli/filelister.cpp:207:38: error: 'union addFiles2(std::map<std::__cxx11::basic_string<char>, long unsigned int>&, const string&, const std::set<std::__cxx11::basic_string<char> >&, bool, const PathMatch&)::<unnamed>' has no member named 'buf'
  207 |             UNUSED(dir_result_buffer.buf); // do not trigger cppcheck itself on the "unused buf"
      |                                      ^~~

I don't know how long this has been the case as the last build I did (1.90 dev) was last year.

It builds OK on Ubuntu, so I'm pretty sure it's not a coding error.

Tag docker image

Could you please add a tag other than latest to your docker images?

This way the dependency is not broken if you change something in the future.

Thanks!

cppcheck: error: unrecognized command line option: "-c".

Hi Neszt,

thanks for providing the docker Conatiner. When i use your docker image inside gitlab i encounter the error

cppcheck: error: unrecognized command line option: "-c".

My yml file looks like follows:

check:
  image: neszt/cppcheck-docker:latest
  except:
    changes:
      - 'doc/**'
      - 'README.md'
  script:
    - bash -c "echo $PWD" 

Do you have an idea what could cause the issue?

Thanks for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.