Tag: ruby在轨道

Docker-compose:在SIGTERM之后closures端口

我在我的开发环境中使用Docker和Docker Compose。 当我在项目之间切换时,通常会遇到一些麻烦,因为我收到了PORT ALREADY IN USE错误。 如果我做docker-compose up (这使得我的轨道服务器启动),是Ctrl+C终止此容器的正确方法? 这是我docker-compose.yml文件: db: image: postgres ports: – "5432" web: build: . command: bundle exec rails s -p 3000 -b '0.0.0.0' volumes: – .:/myapp ports: – "3000:3000" links: – db 有时候,我只需删除./tmp/pids/server.pid ,但有时我必须kill -9一些进程。 这里是例如ps -edf | grep docker ps -edf | grep docker输出: root 742 1 0 Jul18 […]

独angular兽服务器与Galera群集之间的反向代理

我想用Docker做一个架构部署系统。 我有一个与独angular兽沟通的铁路竞争者,他与一个nginx竞争者沟通,在两个系统中我也有两个galera集群。 我想使加莱拉集群与rails应用程序通信,但是我不知道我需要哪个反向代理。 我testing了一个MySQL代理,但我不知道这是否是最好的解决scheme。 编辑:我认为最好的解决scheme是HAproxy。 http://www.severalnines.com/mysql-load-balancing-haproxy-tutorial

泊坞窗percheron卷不安装和容器不启动

我遇到麻烦将我的启动bash脚本转换为使用docker percheron来监视我的容器。 这是我的启动脚本(工作) #!/usr/bin/env bash # Start logitech media server docker run -d -p 9000:9000 -p 3483:3483 -v /home/map7/data/Music/office_music:/mnt/music -v /home/map7/.logitechmediaserver:/mnt/state –name logitechmediaserver map7/logitechmediaserver # Start a client docker run -d –link logitechmediaserver:logitechmediaserver –privileged map7/squeezelite -n server 这是我的.percheron.yml文件启动,但没有卷被安装,并且squeezelite不想启动。 — docker: host: "unix:///var/run/docker.sock" stacks: – name: lms-stack description: Logitech Media Server with a client on the […]

无法从外部访问从命令行启动的dockerized应用程序

我已经用Ruby和一些gem构build了一个Docker镜像作为我的项目的起点。 它可在: jikkujose/trial 。 我正在使用默认的docker-toolbox在Mac上试试。 我正在尝试使用它来托pipe单个文件的应用程序。 我正在启动它,如下所示: docker run -itdP -v .:/app jikkujose/docker 当前目录包含一个文件app.rb ,内容如下: require 'sinatra' class App < Sinatra::Base set :bind, "0.0.0.0" get '/' do 'This is interesting :)' end end App.run! 我可以附加到容器来启动应用程序。 以下是我在做的时候看到的: docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 92498cafd985 jikkujose/trial "/bin/bash" 18 seconds ago Up 18 […]

无法在浏览器中查看在docker容器中运行的rails应用程序

我正在ERR_CONNECTION_REFUSED容器中运行rails应用程序,在执行docker-compose up我在浏览器中查看并查看ERR_CONNECTION_REFUSED 。 我已经尝试通过docker run -p 3000:3000 docker_app端口转发,仍然没有。 有任何想法吗?

在Docker中dynamic加载Ruby容器

我正在为我的Rails项目设置一个Dockerfile。 为此,我正在像这样加载Ruby Docker容器: FROM ruby:2.2.3 我的应用程序已经包含一个在其他地方用来设置版本的.ruby-version文件。 我真的很喜欢避免在我的Dockerfile中重复版本号。 本质上,我想要做这样的事情: Ruby ruby:$(cat .ruby-verison) 上述命令不起作用。 有没有其他方式与Docker完成同样的事情?

如何安装与docker守卫testing?

我正在使用rails,docker。 在我的旧应用程序中,有一些旧的方法和gem。 在我的Gemfile中,我添加了group:development,test:gem'guard-test',github:'guard / guard-test'end 然后运行docker-compose build和docker-compose up ,错误信息是: sidekiq_1 | /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git/git_proxy.rb:155:in `allowed_in_path': The git source git://github.com/guard/guard-test.git is not yet checked out. Please run `bundle install` before trying to start your application (Bundler::GitError) sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git/git_proxy.rb:47:in `revision' sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git.rb:215:in `revision' sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/git.rb:85:in `install_path' sidekiq_1 | from /usr/local/bundle/gems/bundler-1.10.6/lib/bundler/source/path.rb:110:in `expanded_path' sidekiq_1 | […]

如果使用官方docker导轨图像如何添加自我gem文件到Dockerfile?

docker中心的官方导轨图像: https://hub.docker.com/_/rails/ 我创build了一个Dockerfile,如下所示: FROM rails:onbuild ENV RAILS_ENV=production ADD vendor/gems/my_gem /usr/src/app/vendor/gems/my_gem CMD ["sh", "/usr/src/app/init.sh"] 我的init.sh #!/bin/bash bundle exec rake db:create db:migrate bundle exec rails server -b 0.0.0.0 我的Gemfile … gem 'my_gem', path: './vendor/gems/my_gem' … 当我build立我的docker形象时: docker build -t myapp . 它说: … The path `/usr/src/app/vendor/gems/my_gem` does not exist. The command '/bin/sh -c bundle install' returned a […]

无头watir webdrivertesting无法findFirefox

我正在使用docker在gitlab ci ubuntu镜像上设置watir-webdrivertesting。 我正在从Mozilla网站安装Firefox,然后尝试运行testing。 但是,我不断收到selenium无法findFirefox的错误 No such file or directory – /usr/bin/firefox (ChildProcess::LaunchError) 我遵循的步骤来安装Firefox $wget https://ftp.mozilla.org/pub/firefox/releases/35.0/linux-i686/en-US/firefox-35.0.tar.bz2 $tar xjf firefox-35.0.tar.bz2 $cp -r firefox /opt/firefox35 $ln -s /opt/firefox35/firefox /usr/bin/firefox 我尝试将sym链接path更改为/usr/bin/firefox和/usr/local/firefox 我也尝试在env.rb显式设置firefox的path Selenium::WebDriver::Firefox::Binary.path = '/usr/local/firefox' Selenium::WebDriver::Firefox::Binary.path = '../firefox/firefox' Selenium::WebDriver::Firefox::Binary.path = '/usr/local/firefox' Selenium::WebDriver::Firefox::Binary.path = '../firefox/firefox' 即使使用较新版本的Firefox,我也面临同样的问题。 我也尝试使用apt-get包pipe理器安装firefox,结果相同。 有没有人面对这个问题,并能解决呢?

docker工人 – 组成图像卷

我使用docker机,Mac OS X,驱动digitalocean和默认的virtualbox。 Dockerfile: FROM ruby:2.2.0 RUN apt-get update -qq && apt-get install -y build-essential libpq-dev RUN mkdir /myapp-web-api WORKDIR /myapp-web-api ADD Gemfile /myapp-web-api/Gemfile ADD Gemfile.lock /myapp-web-api/Gemfile.lock RUN bundle install ADD . /myapp-web-api 泊坞窗,compose.yml: db: image: postgres ports: – "5432:5432" web: build: . command: rails s -p 3000 -b '0.0.0.0' volumes: – .:/myapp-web-api ports: – […]