X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/3b9ad925609e946b4095231d55a59d80361cc397..87b8bf92a49168bbfc9beb7e7a6df2e6222df710:/Dockerfile?ds=sidebyside diff --git a/Dockerfile b/Dockerfile index 1dca54301..a09077deb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,24 @@ -FROM ruby:2.4 +# Basic Dockerfile to run cookstyle linting +# run: docker build -t test . +FROM ruby:2.6-alpine as build +# Add Gem build requirements +RUN apk add --no-cache build-base + +# Create app directory WORKDIR /app -RUN apt-get update \ - && apt-get install -y --no-install-recommends libssl1.0-dev +# Add Gemfile and Gemfile.lock +ADD Gemfile* ./ -ADD Gemfile* /app/ -RUN gem install bundler && bundle config build.nokogiri --use-system-libraries && bundle install --jobs 4 --retry 5 +# Install Gems +RUN gem install bundler \ + && bundle config build.nokogiri --use-system-libraries \ + && bundle config --global jobs $(nproc) \ + && bundle install -ADD . /app/ +# Add repo +ADD . . -RUN bundle exec rubocop -f fuubar -RUN bundle exec foodcritic -f any cookbooks +# Run linting +RUN bundle exec cookstyle -f fuubar