Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,464,370
Community Members
 
Community Events
176
Community Groups

Bitbucket pipelines docker image with multiple FROM?

Hi,

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? 

1 answer

0 votes
Norbert C Atlassian Team Mar 04, 2022

Hi @Rick Henry 

Thank you for contacting Atlassian Support, I'm Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you!

I would like to inform you that in case you use multiple FROM in a Dockerfile, you can create a "multi-stage build", which generates two seperate Docker images. You can read further about this on the following site: https://docs.docker.com/develop/develop-images/multistage-build/

As a workaround, what I would like to suggest you is to use a similar Docker image in your build like this: https://hub.docker.com/r/timbru31/ruby-node

timbru31 has already created a Docker image, which contains both Ruby and Node.

Please let me know if this helps.

Have a great day!

Best Regards,

Norbert
Atlassian Bitbucket Cloud Support

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events