Merge pull request #745 from chef/dr/docker-release

rake release_docker + smaller image builds
This commit is contained in:
Christoph Hartmann 2016-05-14 10:02:38 +02:00
commit 7c9706bbd7
2 changed files with 15 additions and 5 deletions

View file

@ -1,10 +1,9 @@
FROM ruby:alpine
RUN mkdir /share
RUN apk add --update \
build-base \
libxml2-dev \
libffi-dev
RUN gem install inspec --no-document
COPY inspec.gem /
RUN apk add --update build-base libxml2-dev libffi-dev && \
gem install /inspec.gem --no-document && \
apk del build-base
ENTRYPOINT ["inspec"]
CMD ["help"]
VOLUME ["/share"]

View file

@ -146,3 +146,14 @@ task :bump_version, [:version] do |_, args|
inspec_version(v)
Rake::Task['changelog'].invoke
end
desc 'Release a new docker image'
task :release_docker do
version = Inspec::VERSION
cmd = "rm *.gem; gem build *gemspec && "\
"mv *.gem inspec.gem && "\
"docker build -t chef/inspec:#{version} . && "\
"docker push chef/inspec:#{version}"
puts "--> #{cmd}"
sh('sh', '-c', cmd)
end