Closed halfzebra closed 5 years ago
Thanks for the kind words and repro. Before we investigate further, have you seen any of the following:
Thanks for the quick reply!
Very helpful links, I've read through all of them and here is what I have found.
I've tried adding build dependencies but it did not help.
RUN apk add --no-cache --virtual build-dependencies build-base
Adding Alpine-specific version of glibc
as suggested here did not cut it as well.
RUN apk --no-cache add ca-certificates wget \
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk \
&& apk add glibc-2.29-r0.apk
Both tries have resulted in the original error.
Using node:stretch
works and I might go with it for now.
It does not feel like an elegant solution, because I use a custom image based on node:alpine
to run my apps π
I think it just needs bash to run:
FROM node:8-alpine
RUN apk add --no-cache --virtual build-dependencies build-base
RUN apk --no-cache add ca-certificates wget bash \
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk \
&& apk add glibc-2.29-r0.apk
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY . /app/
RUN npm test
Your test fails, but for the obvious reasons. Let me know how you go. If it works, I might just create a base image for use and update docs.
Adding bash worked for me, thank you for your help! π
Please let me know if I could help with the docs, otherwise, this issue could be closed.
That's great news. I'll mark as an enhancement and will update the docs / example when I get some time. Thanks for the report and repro π
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Bumping so this doesnβt get closed unnecessarily. Should we remove stalebot?
Also, I will check the docs tomorrow and close this off afterwards (if you havenβt already)
I think stalebot is doing its job! Silly old Matt forgot to tag this with "Documentation" and also hasn't updated the docs.
In terms of getting this done, i'm thinking maybe the Wiki is the place for this (or at least, not the README). The README is really growing a bit too large/overwhelming, and I feel this is proverbial straw that justifies the move.
Ideas?
I have added a section to our docs website on Docker, and will reference it in the README shortly: https://docs.pact.io/docker/
Hi, thanks for the example and updating the docs! Is there an official docker image for that reference image (and for other node versions)? i.e.
FROM node:8-alpine
RUN apk add --no-cache --virtual build-dependencies build-base
RUN apk --no-cache add ca-certificates wget bash \
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.29-r0/glibc-2.29-r0.apk \
&& apk add glibc-2.29-r0.apk
I tried using https://hub.docker.com/r/dius/pact-provider-verifier-docker instead, but it errored with line 1: yarn: not found
, so not sure if I'm using it correctly. We want to run yarn install && yarn test
(which runs pactJS) inside a suitable node alpine docker image
We don't have an official docker image for it sorry. Most people seem to want to customise their own base anyway.
I wouldn't use the verifier docker, because it's for a separate thing that doesn't have JS on it.
Can you not just run your own?
Thanks for quick reply! Yea just checking if there's something official first, but we can run our own :)
Cool, worth checking. If we weren't maintaining 12 official languages, we probably would have done it because it's fairly easy - but we have enough stuff to maintain now as it is :)
Actually, I did make a node base image of the cli here https://hub.docker.com/r/pactfoundation/pact-cli/tags?page=1&ordering=last_updated
Ah cool - thanks past Beth! I'll add to docs.
Slightly off topic, but there's also the pact-node binstubs, so you can:
npx -p @pact-foundation/pact-node pact-broker help
for no-install pact CLI usage without docker.
Thanks @bethesque! I may have misunderstood something - that image doesn't have bash
, and so my build errors when yarn test
uses PactJS to verify a consumer pact and write it out to a JSON file:
Should the image allow me to do that, or do I need to add bash? :)
β― docker run -it --rm --entrypoint bash pactfoundation/pact-cli:latest-node14
docker: Error response from daemon: OCI runtime create failed: container_linux.go:370:
starting container process caused: exec: "bash": executable file not found in $PATH: unknown.
You need bash, sorry https://docs.pact.io/docker/#alpine-linux
Hello friends!
Thank you for Pact, I like it very much. π
Unfortunately, I'm unable to get it to work inside Docker. Any ideas on how I might be getting this to work?
Please help!
Software versions
v8.16.0
Expected behaviour
I expect the test to fail gracefully with the following:
Actual behaviour
My test crashes with:
Steps to reproduce
https://github.com/halfzebra/pact-docker-issue