Tag: bundler

在Dockerfile中从Github捆绑

我试图将我们的Rails应用程序移到Docker部署,但是我无法设法从Github引用中获取安装包。 使用下面的Dockerfile: FROM ruby:2.3.0-slim MAINTAINER Chris Jewell <chrisjohnjewell@gmail.com> # Install dependencies: # – build-essential: To ensure certain gems can be compiled # – nodejs: Compile assets # – libpq-dev: Communicate with postgres through the postgres gem # – postgresql-client-9.4: In case you want to talk directly to postgres RUN apt-get update && apt-get install -qq […]

Docker构build无法在Sinatra项目中安装pg gem

我已经审查了所有的post与类似的错误安装Postgres的pggem。 我的问题是独特的:我可以通过Gemfile和bundle install成功地将Postgres添加到我的Sinatra Ruby项目中 – 但是在构buildDocker镜像时,安装pg失败,出现以下错误: ERROR: Error installing pg: ERROR: Failed to build gem native extension. current directory: /usr/local/bundle/gems/pg-0.19.0/ext /usr/local/bin/ruby -r ./siteconf20170113-7-ottv1k.rb extconf.rb checking for pg_config… no No pg_config… trying anyway. If building fails, please try again with –with-pg-config=/path/to/pg_config checking for libpq-fe.h… no Can't find the 'libpq-fe.h header *** extconf.rb failed *** 我已经尝试了类似的答案build议一切: Brew安装/卸载, […]

通过Dockerfile安装包时出错

我是Docker的新手。 我正在尝试在Ubuntu映像上安装捆绑软件包作为父映像。 这是我的Dockerfile的外观 – FROM ubuntu RUN apt-get update RUN apt-get update && apt-get install -y curl RUN apt-get remove -y openssh-client RUN apt-get autoclean && apt-get update && apt-get install -y openssh- server #INSTALL ESSESNTIAL PACKAGES #RUN apt-get -y install zsh htop RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-server #RUN curl -sSL https://rvm.io/mpapis.asc | gpg […]

如何使用相同的Rpectesting来testingRails项目的生产版本?

我正在用Rails构build一个JSON API服务,并使用docker在生产环境中运行它。 在我的Dockerfile中,我想要使用: RUN bundle install –without development test 我有点担心的是Gemfile可能包含一些真正必要的内容:development或者:test 。 这是一个人为的例子Gemfile : # Example situation which works in development and tests but fails in production group :development, :test do gem 'rails', '~> 5.1.4' end 在这种情况下,testing会传递得很好,但生产将被打破。 所以我正在考虑构build生产容器,并使用Docker运行它并公开端口进行testing。 使用相同的Rspec type: request对该容器的type: requesttesting是非常棒的。 testing运行器和rails服务器可以共享相同的testing数据库。 我怎么能强制我的Rspectesting不生成自己的服务器,但使用已经在后台运行的不同的服务?

问题与docker和捆绑

我正在用docker / docker-compose和bundler运行一些问题。 在构build映像后,我可以正确运行rails server ,但是,当我尝试使用rails console运行控制台时,我总是得到: Could not find i18n-0.7.0 in any of the sources Run `bundle install` to install missing gems. 如果我尝试在容器中运行bundle install没有问题,所有似乎都正确安装。 docker-compose run web bundle install … Using spring 1.3.6 Using therubyracer 0.12.2 Using turbolinks 2.5.3 Using uglifier 2.7.2 Using web-console 2.2.1 Updating files in vendor/cache Bundle complete! 24 Gemfile dependencies, […]

Docker Cache BUNDLE INSTALL无法正常工作

任何人都知道如何使最新的DOCKER版本中的BUNDLE INSTALL Cache'ing工作? 我已经尝试了迄今为止: 1. WORKDIR /tmp ADD ./Gemfile Gemfile ADD ./Gemfile.lock Gemfile.lock RUN bundle install 2. ADD . opt/railsapp/ WORKIDR opt/rails/app RUN bundle install 没有一个工作,它仍然运行“BUNDE INSTALL”每次从头开始没有Gemfile被改变。 任何人都知道如何使caching捆绑安装正确工作? 干杯,安德鲁

Rails + Docker:今天ffi gem更新爆发部署?

所以我使用docker在本地开发Rails应用程序,今天突然间(重build后没有caching)我开始在运行docker-compose run以启动独angular兽时遇到以下问题: bundler: failed to load command: unicorn (/usr/local/bundle/bin/unicorn) Bundler::GemNotFound: Could not find ffi-1.9.10 in any of the sources 事实上,我的sidekiq容器也在提高这一点。 我意识到ffi最近更新到1.9.11,但是不应该在bundler中解决这个依赖关系吗? 其他信息:具有完整的2.2.5docker图像的Ruby 2.2.5。 我在我的dockerfile中进行捆绑,以便在构build之间caching内容,并且不要将我的Gemfile.lock复制到构build中的Docker镜像上(在此过程之后)。 ffi-1.9.10出现在我的本地非docker gemfile.lock中,作为一个顶层的依赖,但不是在我的Gemfile中。 我现在通过在Gemfile中明确要求1.9.10来解决这个问题,但是我对这个答案并不满意。

在Docker容器中获取代理后面的git

我一直坚持了几个小时试图从docker容器内运行的代理运行后的git。 Removing intermediate container 84c4f6722d09 Step 16 : RUN bundle install –without development test —> Running in bbc7bfff1bae Fetching gem metadata from https://rubygems.org/……… Fetching version metadata from https://rubygems.org/… Fetching dependency metadata from https://rubygems.org/.. Fetching git://github.com/seuros/state_machine.git 我可以确认我的代理在Dockerfile中适用于apt-get和早期的git clone命令。 任何想法是什么做错了吗? 这是我的Dockerfile FROM ruby:2.2.4 LABEL Description="slack-standup-bot (`master`) from ruby:2.2.4" ENV DEBIAN_FRONTEND noninteractive ENV TERM xterm ENV http_proxy http://192.168.0.43:8888 […]