Hi Pact team! I wanted to ask what is the ideal se...
# pact-go
e
Hi Pact team! I wanted to ask what is the ideal setup in installing
pact-go
package in docker when running in a CI pipeline (in this case, buildkite)? I've encountered issues saying that
pact-go: command not found
but installed in in my Dockerfile and part of the
Makefile
command which runs the container and installs the package within it. I'm still learning the ways of docker so there are some terms new to me
Copy code
2024/01/19 00:57:52 [WARN] Usage of musl library is known to cause problems, prefer using glibc instead.
2024/01/19 00:57:52 [INFO] downloading library from <https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v0.4.5/libpact_ffi-linux-x86_64.so.gz> to /usr/local/lib/libpact_ffi.so
&{}
2024/01/19 00:57:54 [INFO] package libpact_ffi found
2024/01/19 00:57:54 [INFO] checking version 0.4.5 of libpact_ffi against semver constraint >= 0.4.0, < 1.0.0
2024/01/19 00:57:54 [INFO] package libpact_ffi is correctly installed
/bin/sh: line 2: pact-go: command not found
Here's the
Dockerfile
Copy code
FROM public.ecr.aws/docker/library/alpine:latest


RUN apk add --no-cache git make musl-dev go
RUN go version

# Configure Go
ENV GOROOT /usr/lib/go
ENV GOPATH /go
ENV PATH /go/bin:$PATH

RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin

# Install pact-go
RUN go install <http://github.com/pact-foundation/pact-go/v2@v2.0.2|github.com/pact-foundation/pact-go/v2@v2.0.2>
ENV GOPATH /go
ENV PATH /go/bin:$PATH
and the command to run the test
Copy code
docker compose run go-builder-pact  \
		pact-go install -f && pact-go -l DEBUG install && go test -v -timeout 120s -count=1 ./tests/contract/... --tags=pact
Thank you!