rastasheep / alpine-node-chromium

Dockerized chromium inside node alpine image
MIT License
37 stars 22 forks source link

Can't run pact-mock-server #6

Open nieldw opened 6 years ago

nieldw commented 6 years ago

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
nieldw commented 6 years ago

Related to https://github.com/pact-foundation/pact-js/issues/154

nieldw commented 6 years ago

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
nieldw commented 6 years ago

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
omnibrain commented 6 years ago

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