Docker-node: Alpine image cannot be used with Atlassian pipelines

Created on 16 Feb 2017  路  12Comments  路  Source: nodejs/docker-node

Hi,

The Alpine version must contain bash in order to be usable with Atlassian pipelines. See here.

Thanks

Most helpful comment

Actually, it turned out one of our devs had already been trying to fix this in his spare time. He cleaned up the code and now Bitbucket Pipelines falls back to /bin/sh when bash is not available.

In our testing, this works for alpine images, although we haven't done extensive testing - like with this node image, for example.

If the OP wants to try it out, please report any problems as a new ticket at https://bitbucket.org/site/master/issues. Thanks!

All 12 comments

Is anything preventing you from installing bash in your Dockerfile like this:

RUN apk add --no-cache bash

The whole reason for the alpine variant is to be as small as possible. If you need bash will need to make your own image which extends node:alpine.

@pesho The pipelines fail at the first build step (where we have no control)

@Starefossen I assumed the official node alpine image would contain bash as the jekyll official image does. Perhaps a note on the official page to specify that the alpine images cannot be used with Atlassian Pipelines would spare others of the pain 馃槃 .

Thanks,
Simo

Are you sure you can not set the entrypoint of the image in Atlassian Pipelines to something other than bash? Something like entrypoint=/bin/sh?

Yes. There's no way to bypass the bash requirement in the Bitbucket cloud version.
I have no ideea if it can be tweaked somehow on a Bitbucket server instance.

Maybe we can get the attention of some Atlassian emplyees if they can support custom entrypoint or fall back to /bin/sh if bash does not exist in the Docker Image. //CC @mattryall @ash2k

@Starefossen I've pinged Pipelines team.

Awesome!
Thanks @ash2k , @Starefossen , @pesho !

We have an issue open tracking this problem in Pipelines here: https://bitbucket.org/site/master/issues/12864/support-for-alpine-images-using-bin-sh-in

We would like to address this in the product, but have a couple of other higher priority items to deliver right now, including support for Docker build/push in Pipelines. Unfortunately changing our default shell (or falling back as suggested above) is non-trivial given the number of customers running builds on Pipelines, so we need to schedule this and make sure it is properly tested.

Thanks,
Matt Ryall
Product Manager, Bitbucket Pipelines

Actually, it turned out one of our devs had already been trying to fix this in his spare time. He cleaned up the code and now Bitbucket Pipelines falls back to /bin/sh when bash is not available.

In our testing, this works for alpine images, although we haven't done extensive testing - like with this node image, for example.

If the OP wants to try it out, please report any problems as a new ticket at https://bitbucket.org/site/master/issues. Thanks!

This is so awesome @mattryall and that dev deserves a 馃嵑馃槃 I am sure that many users of Bitbucket Pipelines and Node.js will be happy to hear this 馃帀

I am one of them. Just tested the node:alpine image with Pipelines and it works!

馃嵒 for devs!

Was this page helpful?
0 / 5 - 0 ratings