docker-compose.yml 无法使用自定义配置启动 ruby 应用程序
我有一个小型机架应用程序,我使用 docker-compose.yml 为其配置开发环境 该
应用程序将安装到图像,没有 docker,它可以使用bundle execrackup 正常运行 - p 3030
此配置的想法来自
rel="nofollow noreferrer">这篇文章适用于节点应用程序,但在将其移植到 ruby Makefile
install:
docker-compose -f docker-compose.builder.yml run --rm install
run:
docker-compose up
docker-compose.builder.yml
version: '2'
services:
base:
image: ruby:3.0.3
volumes:
- .:/usr/src/service/
working_dir: /usr/src/service/
install:
extends:
service: base
command: bash -c "bundle config set --local path './.vendor' && bundle install"
docker-compose.yml
version: '3'
services:
dev:
image: ruby:3.0.3
volumes:
- .:/usr/src/service
working_dir: /usr/src/service
command: /usr/local/bin/bundle exec ./.vendor/ruby/3.0.0/bin/rackup -p 3030
ports:
- 3030:3030
我的安装脚本似乎工作正常好吧,
$ make install
docker-compose -f docker-compose.builder.yml run --rm install
WARNING: Found orphan containers (backbone_dev_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Creating backbone_install_run ... done
...
Bundle complete! 18 Gemfile dependencies, 64 gems now installed.
Bundled gems are installed into `./.vendor`
我的问题似乎是我的脚本运行我的应用程序
$ make run
docker-compose up
Starting backbone_dev_1 ... done
Attaching to backbone_dev_1
dev_1 | /usr/bin/env: ‘ruby_executable_hooks’: No such file or directory
backbone_dev_1 exited with code 127
I have a small rack application that im configuring a development environment for, using docker-compose.yml
The application will be mounted to an image, without docker it runs just fine using bundle exec rackup -p 3030
the idea for this configuration comes from this article for a node app, but im running into some snags when porting it over to ruby
Makefile
install:
docker-compose -f docker-compose.builder.yml run --rm install
run:
docker-compose up
docker-compose.builder.yml
version: '2'
services:
base:
image: ruby:3.0.3
volumes:
- .:/usr/src/service/
working_dir: /usr/src/service/
install:
extends:
service: base
command: bash -c "bundle config set --local path './.vendor' && bundle install"
docker-compose.yml
version: '3'
services:
dev:
image: ruby:3.0.3
volumes:
- .:/usr/src/service
working_dir: /usr/src/service
command: /usr/local/bin/bundle exec ./.vendor/ruby/3.0.0/bin/rackup -p 3030
ports:
- 3030:3030
my install script seems to work just fine
$ make install
docker-compose -f docker-compose.builder.yml run --rm install
WARNING: Found orphan containers (backbone_dev_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Creating backbone_install_run ... done
...
Bundle complete! 18 Gemfile dependencies, 64 gems now installed.
Bundled gems are installed into `./.vendor`
my issue seems to be with my script to run my app
$ make run
docker-compose up
Starting backbone_dev_1 ... done
Attaching to backbone_dev_1
dev_1 | /usr/bin/env: ‘ruby_executable_hooks’: No such file or directory
backbone_dev_1 exited with code 127
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论