Bitbucket 使用多个 FROM 管道处理 docker 镜像?
首先,我是 Docker 的新手!我目前正在尝试创建自己的 docker 映像,我可以在我的 bitbucket 管道中使用它。我想做的是将节点和 ruby 安装在同一个容器上。这是我当前的 Dockerfile
的样子:
FROM node:12.22.10
FROM ruby:2.7.5
我已经构建、标记并推送了该映像,并在我的 bitbucket-pipelines.yml
中使用它,并且我正在尝试运行此步骤脚本:
script:
- yarn install
- gem install bundler -v 2.2.29
当在管道中运行时,我收到此错误:
bash: yarn: command not found
我尝试了一些方法,我删除了 FROM ruby:2.7.5
并且纱线命令有效,但显然 <代码>宝石安装捆绑器... 没有。所以,我知道 Dockerfile 和镜像正在工作,但我不知道如何在我自己的 Dockerfile 中使用这两个镜像。有谁知道我做错了什么?
First of all, I'm brand new to Docker! I am currently trying to create my own docker image which I can use in my bitbucket pipelines. What I am trying to do is install node and ruby on the same container. Here is what my current Dockerfile
looks like:
FROM node:12.22.10
FROM ruby:2.7.5
I've built, tagged and pushed this image and use it in my bitbucket-pipelines.yml
and I'm trying to run this step script:
script:
- yarn install
- gem install bundler -v 2.2.29
When this is run in the pipeline I get this error:
bash: yarn: command not found
I've tried a couple of things, I removed the FROM ruby:2.7.5
and the yarn command worked but obviously the gem install bundler...
did not. So, I know that the Dockerfile and image are working but I don't know how to use both images in my own Dockerfile. Does anyone know what I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论