Checking on empty gems cache fails using Serverspec for Docker image build testing
问题 I'm currently having an issue with testing Docker image builds by means of Serverspec. In a nutshell, what I want to do is ensuring that during the image build the Ruby gems build cache gets cleared explicitly, e.g. by issuing rm -rf /usr/lib/ruby/gems/*/cache/*.gem in the Dockerfile. The Dockerfile skeleton I'm working with looks like this: # Dockerfile FROM alpine:3.7 RUN apk add --no-cache \ dumb-init \ ruby \ && apk add --no-cache --virtual .build-deps \ build-base \ ruby-dev RUN gem