mserranom / bbrun

Run Bitbucket Pipelines locally
MIT License
203 stars 32 forks source link

Fails with Alpine linux images (i.e Docker in Docker) #39

Closed lucianosantana closed 4 years ago

lucianosantana commented 5 years ago

Used the hello-world bitbucket-pipelines.ymland changed the docker image to docker:stable See more here

So the file ends-up like this:

pipelines:
  default:
    - step:
          image: docker:stable
          script:
            - echo "hello world!"

After running bbrun I get the following error:

executing step in "docker:stable"
/usr/local/bin/docker-entrypoint.sh: exec: line 35: bash: not found

If you check the line 35 of docker-entrypoint.sh file in the docker image repo you see it's just an "exec" command.

Checking on docker.js file, I see it uses bash as shell and Alpine Linux doesn't uses bash it uses sh instead.

I've tested changing the bash references with sh on docker.js and it works both for Ubuntu and Alpine images. Ideally we should point the shell to be used dynamically. Maybe using $SHELL or $0 enviroment variables. I've tried quickly but couldn't make it work. So I'll submit a Pull Request with what I have shortly.