Tag: ruby在轨道

在Windows 7上的Docker撰写:找不到Gemfile或.bundle /目录

当我运行docker-compose up命令时出现以下错误 找不到Gemfile或.bundle /目录 退出代码10 以下是代码。 注意:我已经使用Oracle VM虚拟框pipe理器将我的代码的父目录作为永久共享文件夹添加到VM。 任何想法来解决这个问题。 Dockerfile FROM ruby:2.3.0 ENV HTTP_PROXY http://proxy.com:8080 ENV HTTPS_PROXY http://proxy.com:8080 RUN mkdir /student-api WORKDIR /student-api ADD Gemfile /student-api/Gemfile ADD Gemfile.lock /student-api/Gemfile.lock RUN bundle install ADD . /student-api Docker撰写 db: image: postgres ports: – "5432:5432" web: build: . command: bundle exec rails s -p 3000 -b '0.0.0.0' volumes: […]

如何从Docker访问我的本地系统Postgres

当我在自己的机器上使用Docker时,我想访问我的系统的Postgres。 这是我的图像部署之前,我想要使用RDS的AWS。 我遵循Docker的Quickstart:Docker Compose和Rails页面上的步骤,除了因为我正在使用现有的应用程序,我没有创build刚加载Rails的初始最小化Gemfile。 在Docker容器的外面,Postgres被安装并正常工作: $ which postgres /Applications/Postgres.app/Contents/Versions/latest/bin/postgres $ which pg_restore /Applications/Postgres.app/Contents/Versions/latest/bin/pg_restore $ which pg_dump /Applications/Postgres.app/Contents/Versions/latest/bin/pg_dump 这个应用程序在没有Docker的情况下工作得很好。 为了再次testingDocker容器之外的应用程序,我将Docker推荐docker-compose.yml文件的一行注释如下: development: &default adapter: postgresql encoding: unicode database: postgres pool: 5 username: postgres password: # host: db test: <<: *default database: myapp_test 当我这样做的时候,我可以运行rake db:test:clone (例如)在容器外面不用担心: 但是当我取消注释并连接到容器中的一个TTY时,我感到非常痛苦: /myapp# rake db:test:clone pg_dump -s -x -O -f /myapp/db/structure.sql postgres Please […]

使用Vagrant设置swarm模式的Docker Swarm

我正在使用Vagrant和当地的一家供应一些DEV最小的centos虚拟机。 这些虚拟机都运行Docker 1.12.x,现在我正在考虑自动创build一个群集模式群集。 我们的目标是做到vagrant up ,当气候回归时,我有一个集群起来跑步。 我遇到的麻烦是我可以在其中一个盒子上运行一个docker swarm init –advertise-addr <my init swarm mgr> ,但是我需要从这个盒子中取出pipe理器和工作节点的标记,并将它们注入随后build立的虚拟机。 我无法编程Ruby,如果我能避免它,我真的不会开始使用Docker Remote API。 我已经试过从一个testing虚拟机设置请求hostid尝试和分配一个来宾cmd输出到Vagrantfile中的一个variables,但我的Ruby没有达到从头开始。 无论如何,问题是如何在使用本地虚拟机configuration虚拟机时使用Vagrant创build群集模式群集。 编辑:我刚才看到stream浪的scp ,我至less可以用它来提取文件的forms的令牌,并将其复制到相关的机器。 我希望保持纯粹的东西而不是插入,并且避免使用Ruby来运行更多的stream浪命令(有没有更好的方法来做到这一点?),但至less可以利用stream浪汉和当地人。

用docker设置puma,rails和nginx的正确方法是什么?

我有一个使用Puma的Rails应用程序。 我正在使用nginx进行负载平衡。 我想dockerize和部署到DigitalOcean(docker)滴。 在阅读了大量的博客和例子(其中大部分都是一年,在Docker世界里已经很长时间了)之后,我仍然对2件事感到困惑。 假设我select一个带有4个CPU的DigitalOcean盒子。 我该如何设置Rails容器? 我应该设置4个不同的容器,Pumaconfiguration了1个工作进程吗? 还是应该在Pumaconfiguration4个工作进程的地方设置一个容器? 第二件事我很困惑:我应该在Rails容器中运行nginx,还是应该在不同的容器中运行它们? 这两个问题允许我在下面列出的4个排列组合。 选项1 选项2 选项3 选项4

无法在dockerized rails应用程序中从git安装gem

请帮助我build立我的第一个docker形象。 我的Gemfile包含: gem 'webpacker', github: 'rails/webpacker' 这里是Dockerfile : FROM ruby:2.4-alpine … ADD Gemfile $INSTALL_PATH/Gemfile ADD Gemfile.lock $INSTALL_PATH/Gemfile.lock RUN bundle install ADD . $INSTALL_PATH … docker工人和docker工人: Docker version 17.03.1-ce, build c6d412e docker-compose version 1.13.0, build 1719ceb 当我跑步 docker build . 我收到错误: Fetching https://github.com/rails/webpacker.git sh: git: not found Git error: command `git clone 'https://github.com/rails/webpacker.git' "/usr/local/bundle/cache/bundler/git/webpacker- 61415c05b31197242a5fde705ba334f36321be12" –bare […]

如何解决错误“捆绑器无法find适用于gemX的兼容版本”

我正在尝试为我的项目设置docker。 我曾尝试安装actionpack 5.0.2,但它并没有对我有任何好处。 我正在关注如何设置教程,所以我认为有版本问题。 当我运行docker-compose时,这是我得到的: Bundler could not find compatible versions for gem "actionpack": In Gemfile: rails (~> 5.0.2) ruby depends on actionpack (= 5.0.2) ruby actionpack (>= 5.1.1, ~> 5.1) ruby 这是我的Gemfile: source 'https://rubygems.org' git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") "https://github.com/#{repo_name}.git" end gem 'devise' gem 'bootstrap-sass', '~> 3.3.6' gem 'sass-rails', '>= 3.2' […]

如何使用Docker和Fig更新导轨应用程序,零宕机时间?

我正在使用Docker和Fig for我的Rails / Postgres应用程序。 推动更新到Rails应用程序到生产的最佳方式是什么? 目前,我在生产中运行以下脚本,但会导致大约10秒的停机时间: sudo fig pull web sudo fig up -d web 我想在graphics重新创buildweb容器时会发生停机。 这是我在生产中使用的fig.xml文件。 db: image: postgres:9.3 volumes_from: – db-data ports: – 5432 web: image: myaccount/my_private_repo command: bundle exec unicorn -p 3000 -c ./config/unicorn.rb volumes_from: – gems-2.1 ports: – "80:3000" links: – db 该应用程序的演示在这里: https : //github.com/evgenyneu/docker-rails-fig-sample

docker是一个可能的解决scheme,以rubyGIL限制在轨道?

这只是一个想法,让我知道如果我错过了什么,或者如果它可以是一个好的。 在单个服务器/虚拟机上运行N个rails进程是很常见的,但由于GIL(Global Interpreter Lock,全局解释器锁),最多不能执行。 而不是在单个服务器内部运行N个进程,我可以用一个单独的rails进程(每个运行在不同的端口上)运行N个容器。 通过这种方式,我应该能够并行执行更多的rails进程,对吧? 我猜容器增加了开销,但可能无论如何它可能是有意义的。 有什么意见? 谢谢

八面体与Alpine Linux的Docker化

我不确定这是否是正确的地方问这个问题。 我会尽力。 如果不合规请closures。 我遇到的问题是,使用octopress dockerizing来在github.io上发布内容,特别是在Alpine Linux上。 这是我的Dockerfile: FROM alpine:edge MAINTAINER Emanuele Ianni <dierre@gmail.com> ENV BUILD_PACKAGES bash curl-dev build-base git ENV RUBY_PACKAGES ruby ruby-dev ruby-io-console ruby-bundler ENV EXECJS_DEPENDENCY nodejs ENV GIT_URL https://github.com/invasionofsmallcubes/invasionofsmallcubes.github.io.git # Update and install all of the required packages. # At the end, remove the apk cache RUN apk update && \ apk upgrade […]

运行Docker时无法运行ruby命令

我有一个我用Ruby创build的图像。 我可以运行Ruby命令, irb并在运行时在映像中install gems : docker run -it jikkujose/apple 我也可以这样做来列出容器中的文件: docker run -it jikkujose/apple ls 但是当我尝试运行Ruby命令时,它失败了: docker run -it jikkujose/apple ruby -e "puts 'Hello'" 错误: Error response from daemon: Cannot start container c888aa8d2c7510a672608744a69f00c5feda4509742d54ea2896b7ebce76c16d: [8] System error: exec: "ruby": executable file not found in $PATH