Tag: ruby on rails

Docker无法在Rails bundle上安装rake

我使用Docker for Windows来运行Rails(v5)应用程序的Image。 当我做docker构build我得到这个错误。 我不知道在哪里寻找debugging和/或解决这个问题。 这里是我的DockerFile:从ruby:2.3.3-slim RUN apt-get update && apt-get install -y build-essential RUN apt-get install -y libmysqlclient-dev RUN apt-get install -y mysql-client RUN apt-get install -y libmagickwand-dev imagemagick RUN apt-get install -y curl RUN curl -sL https://deb.nodesource.com/setup_6.x | bash – RUN apt-get install -y nodejs RUN apt-get install -y git #RUN npm install […]

具有发布的端口的Docker容器不能从外部访问

我的Docker容器在端口3000上运行Rails,并将端口发布到端口8900 。 看到: $ docker-compose ps Name Command State Ports rails_poc_1 /bin/sh -c puma -C config/ … Up 0.0.0.0:3000->8900/tcp 但是,当访问http://localhost:8900我的浏览器显示ERR_CONNECTION_REFUSED 。 当从容器内使用docker exec 8fcceed1d477 curl localhost:3000 curl端口3000 ,我得到一个有效的响应,certificateRails工作正常。 我可以俯视吗?

在Docker容器中运行Rails应用程序

我想在一台debian机器上的Docker容器中运行Rails 4.2.1应用程序。 当我运行bundle exec rails时,出现这个错误: Could not find json-1.7.7 in any of the sources Run `bundle install` to install missing gems. 当我运行软件包安装时,我得到这个错误: Gem :: Ext :: BuildError:错误:无法构buildgem原生扩展。 /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150604-137-10l84fa. rb extconf.rb creating Makefile make "DESTDIR=" clean make "DESTDIR=" compiling generator.c In file included from generator.c:1:0: ../fbuffer/fbuffer.h: In function 'fbuffer_to_s': ../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires […]

使用Docker和Jenkins运行testing – testing结果

我有一个用Rails编写的应用程序。 为了testing它,我构build了一个docker镜像。 一切工作正常。 但是,当我configurationJenkins运行这些testing时出现这个问题。 以下是我在做的步骤: docker-compose up rspec 其中rspec是在docker-compose.yml中定义的服务,包含以下命令: command: "rspec spec/" 当rspec返回错误时,构build仍然成功。 这里输出的一个例子: … 21:42:24 [36mrspec_1 |[0m should save second profile 21:42:24 [36mrspec_1 |[0m 21:42:24 [36mrspec_1 |[0m Failures: 21:42:24 [36mrspec_1 |[0m 21:42:24 [36mrspec_1 |[0m 1) New profile Should persist new_profile_pricture 21:42:24 [36mrspec_1 |[0m Failure/Error: jump_to_four_phase_with(new_profile_picture) 21:42:24 [36mrspec_1 |[0m RuntimeError: 21:42:24 [36mrspec_1 |[0m Timeout for […]

在Docker上进行ruby捆绑优化

我是新来的docker工人,想知道如何重新build立docker图像ruby捆绑机的行为? 我第一次构build映像时,需要永久bundle install 。 当我在Gemfile中添加另一个gem时会发生什么? 有没有办法确保以前的gem在图像中以某种方式被caching,并用于这个新的捆绑? Dockerfile: FROM rails:onbuild RUN apt-get install -y imagemagick

使用docker-compose来Docker化Rails应用程序

嗨,我正在尝试将我的应用程序调整为泊坞窗。 我的应用程序堆栈是 Ruby 2.4.0 Rails 5.0.1 Postgres 9.5.8 我创build了一个Dockerfile来创build一个my-app的图像 FROM ruby:2.4 RUN apt-get update && apt-get install -y \ software-properties-common \ python-software-properties \ build-essential \ libpq-dev \ libxml2-dev libxslt1-dev \ libqt4-webkit libqt4-dev xvfb \ nodejs \ postgresql RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY Gemfile /usr/src/app COPY Gemfile.lock /usr/src/app RUN bundle install ADD . /usr/src/app […]

将Rails和React应用程序拆分到不同的Docker容器中?

我有一个Rails后端和一个React前端的应用程序。 我将它部署在Docker容器中:一个用于应用程序,一个用于postgres,另一个用作数据卷容器。 我有它的工作,但应用程序图像文件是巨大的(3Gb!),并需要很长时间来build立。 我很乐意将它分开。 React应用程序需要一堆Node包,但仅用于开发; 一旦它是所有的webpack-react应用程序本质上是静态文件。 而Rails应用程序根本就不需要Node。 我不需要生产映像中的所有开发时间工具,但实际上,我觉得我需要将它们都放在同一个代码库中,这样我才能(最终)设置一个可以构build的CI / CD环境该应用程序并运行所有的testing。 有没有办法做到这一点,我会有一个React / Node应用程序容器和Rails容器,并在运行时连接它们?

在同一个ec2实例中运行Docker和Jekyll

我有一个叫做话语的应用程序,在我的ec2实例中运行。 它使用Docker来提供http请求。 每一件事都与话语正常工作。 现在我想在同一台服务器上托pipe我的博客。 我能够生成一个jekyll网站,我也能够提供页面,但问题是指向DNSlogging。 我的话语网站可以很好地解决任何障碍,但我的网站需要加载端口号。 我的意思是,我的博客不会加载域名中的端口号。 像http://domain.com:4000 如何运行这两个应用程序服务器以在端口80上运行,或者如何为任何请求提供端口80以及4000的请求。 请注意,我不能使用Apache mod_proxy来代理请求。 请提出可行的解决scheme。 处理这种情况。 以下是我的环境细节: 操作系统: – Ubuntu 13.10 Ruby版本: – 2.0.0 提前致谢 。

ADD之后图像层的不合理增加。 句子

我正在使用Docker(lxc-docker v1.3.0)来构build我的Rails web应用程序图像,如下所示: FROM ubuntu:14.04 <some sentences here> WORKDIR /project # gems install RUN gem install bundler ADD Gemfile /project/Gemfile ADD Gemfile.lock /project/Gemfile.lock RUN bundle install # assets precopile ADD Rakefile /project/Rakefile ADD public /project/public ADD vendor /project/vendor ADD config/environments /project/config/environments ADD config/application.rb config/boot.rb config/compass.rb config/environment.rb /project/config/ ADD app/assets /project/app/assets RUN bundle exec rake assets:precompile\ […]

如何将包添加到已经存在的图像?

我有一个使用在Gemfile中指定的imagemagick的RoR应用程序。 我使用Docker的官方导轨图像来构build我的图像与以下Dockerfile: FROM rails:onbuild RUN apt-get install imagemagick 并得到以下错误: Cant install RMagick 2.13.2. Cant find Magick-config in /usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 现在,这可能是因为在操作系统上缺lessimagemagic软件包,即使我在Dockerfile中指定了它。 所以我猜在RUN apt-get命令之前发出了bundle install命令。 我的问题 – 使用这个基本的形象,有没有一种方法来确保imagemagic在捆绑之前安装? 我是否需要fork和更改基础图像Dockerfile来实现?