Tag: docker工人

铁轨找不到耙gem

我有一个在docker中运行的基本Rails应用程序。 我可以很好地启动它并提供响应。 我可以跑rake -T就好了。 但是我无法运行Rails生成命令。 它告诉我Could not find rake-12.3.1 in any of the sources $ docker-compose run main bundle exec rails generate controller Welcome index Starting cognitopoc_db_1 … done Could not find rake-12.3.1 in any of the sources Run `bundle install` to install missing gems. 这是我的捆绑环境: $ docker-compose run main bundle env Starting cognitopoc_db_1 … […]

使用Serverspec进行Docker映像构建测试,检查空gems缓存失败

我目前遇到的问题是通过Serverspec测试Docker镜像构建。 简而言之,我想要做的是确保在图像构建期间显式清除Ruby gems构建缓存,例如通过在Dockerfile中发出rm -rf /usr/lib/ruby/gems/*/cache/*.gem 。 我正在使用的Dockerfile骨架如下所示: # 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 install –no-rdoc –no-ri json \ && gem install –no-rdoc –no-ri oj RUN apk del .build-deps \ && rm -rf /var/cache/apk/* \ /tmp/* /var/tmp/* […]