rastasheep/alpine-node-chromium

Can't run pact-mock-server

nieldw opened this issue · 4 comments

I'm trying to run Pact-JS with Karma to do consumer tests, but I'm unable to run pact-mock-service.

I've created a sample project illustrating the problem: https://github.com/nieldw/pact-karma-alpine-issue

The error I'm getting is:

WARN: pact-node@4.12.0/1 on 3d34c88a62ad: Pact exited with code 127.

I've tried the solution at https://github.com/pact-foundation/pact-ruby-standalone/wiki/Using-the-pact-ruby-standalone-with-Alpine-Linux-Docker, basically, adding:

RUN apk add --no-cache --virtual build-dependencies build-base

However, this fails with

ERROR: unsatisfiable constraints:
  musl-1.1.19-r4:
    breaks: musl-dev-1.1.19-r7

Workaround for the unsatisfiable constraint issue:

RUN apk add --no-cache musl=1.1.19-r7
RUN apk add -v --no-cache --virtual build-dependencies build-base

By also installing bash I can get the pact-mock-service script starting, but then it fails because it can't find the ruby bin. I'm not sure if that's a problem with this image, or with pact not downloading the binary.

RUN apk add --no-cache musl=1.1.19-r7
RUN apk add -v --no-cache --virtual build-dependencies build-base bash
RUN ./node_modules/@pact-foundation/pact-mock-service-linux-x64/bin/pact-mock-service

Results in:

/build/node_modules/@pact-foundation/pact-mock-service-linux-x64/lib/ruby/bin/ruby: line 6: /build/node_modules/@pact-foundation/pact-mock-service-linux-x64/lib/ruby/bin.real/ruby: No such file or directory

I'm facing the same problem. Any solution for this?