You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: website/docs/docker.md
+71-27
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,11 @@ Often times, you'll want to use Docker to run Pact. For example, a common approa
8
8
9
9
We provide official containers to run common utilities as Docker images. All images from the `"pactfoundation"`[repository](https://hub.docker.com/u/pactfoundation) can be considered official:
10
10
11
-
* CLI Tools: [https://hub.docker.com/r/pactfoundation/pact-cli](https://hub.docker.com/r/pactfoundation/pact-cli)\(includes the Ruby implementation of the mock service, a language agnostic provider verifier, and the Pact Broker client tools.\)
* CLI Tools: [https://hub.docker.com/r/pactfoundation/pact-cli](https://hub.docker.com/r/pactfoundation/pact-cli)(Pact Broker client tool plus the Ruby implementation of the mock service & provider verifier.)
@@ -20,10 +22,10 @@ If you want to run your Pact tests in Docker, please note the following guidance
20
22
21
23
#### For Pact implementations that use the [Rust shared core](roadmap/feature_support)
22
24
:::info
23
-
**Applicable languages**: Pact JS, Pact .NET, Pact Go, Pact C++ and Pact Swift
25
+
**Applicable languages**: Pact JS, Pact .NET, Pact Go, Pact-PHP, Pact C++ and Pact Swift
24
26
:::
25
27
26
-
Pact currently requires glibc `>= 2.29`. Most modern debian-based images will ship with a compatible version.
28
+
Pact currently requires glibc `>= 2.23`. Most modern debian-based images will ship with a compatible version.
27
29
28
30
You can check the version of glibc installed via the `ldd` command:
29
31
@@ -39,13 +41,36 @@ Written by Roland McGrath and Ulrich Drepper.
39
41
If you see an error that looks like the following, taken from a JS project, it means your version of glibc is incompatible:
40
42
41
43
```
42
-
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by /app/node_modules/@pact-foundation/pact-core/build/Release/libpact_ffi.so)
44
+
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.23' not found (required by /app/node_modules/@pact-foundation/pact-core/build/Release/libpact_ffi.so)
43
45
```
44
46
47
+
For a more exhaustive list of glibc versions against distroes, see the below table
48
+
49
+
Distribution | glibc version
50
+
-- | --
51
+
Arch Linux | 2.36
52
+
Alpine 3.13 | N/A
53
+
CentOS 7 | 2.17
54
+
CentOS Stream 8 | 2.28
55
+
CentOS Stream 9 | 2.34
56
+
Debian 9 (Stretch) | 2.24
57
+
Debian 10 (Buster) | 2.28
58
+
Debian 11 (Bullseye) | 2.31
59
+
Fedora 35 | 2.34
60
+
Homebrew | 2.23
61
+
OpenSUSE Leap 15.3 | 2.31
62
+
OpenSUSE Tumbleweed | 2.35
63
+
RHEL 7 | 2.17
64
+
RHEL 8 | 2.28
65
+
RHEL 9 | 2.34
66
+
Ubuntu 18.04 | 2.27
67
+
Ubuntu 20.04 | 2.31
68
+
Ubuntu 22.04 | 2.35
69
+
45
70
46
71
#### For Pact implementations that use the [Ruby shared core](roadmap/feature_support)
47
72
:::info
48
-
**Applicable languages**: Pact PHP, Python
73
+
**Applicable languages**: Python
49
74
:::
50
75
51
76
Pact currently [requires](https://github.com/phusion/traveling-ruby/blob/10262231f19238c638e7a4806408cf1e57cb2dca/CHANGELOG.md#version-20210206) glibc `>= 2.17`. The minimum supported Linux version is now RHEL 7 / CentOS 7 / Debian 8 / Ubuntu 14.06 / glibc 2.17.
@@ -55,41 +80,67 @@ Pact currently [requires](https://github.com/phusion/traveling-ruby/blob/1026223
55
80
Here is an example JS container that will run Pact tests within an official Node container based on Debian.
*NOTE: we are installing some build tools here to allow native dependencies to be compiled, this is a prerequisite for many NodeJS packages, including Pact. Other languages may not require this*
71
94
72
95
### Alpine Linux
73
96
74
97
Many teams choose to run builds on Alpine Linux due to its tiny footprint, and smaller security surface area.
75
98
76
99
#### For Pact implementations that use the [Rust shared core](roadmap/feature_support) or
77
100
:::info
78
-
**Applicable languages**: Pact JS, Pact .NET, Pact Go, Pact C++ and Pact Swift
101
+
**Applicable languages**: Pact JS, Pact .NET, Pact Go, Pact-PHP, Pact C++ and Pact Swift
79
102
:::
80
103
81
-
Alpine is not supported as it requires us to build dynamically linked libraries for each specific version of Alpine and musl.
104
+
- Executable builds are static, and therefore the single binary works across musl or glibc based distros (excluding ffi)
105
+
- pact_ffi library comes in both static `*.a` & shared `*.so` variants for musl, depending on the consuming client libraries requirements for ffi interop
106
+
107
+
Support is available in the following tools for Alpine from specific versions.
108
+
109
+
| library | alpine support | version |
110
+
| -- | -- | -- |
111
+
| pact_ffi | ✅ | - `x86_64``.a` from [0.2.4](https://github.com/pact-foundation/pact-reference/releases/tag/libpact_ffi-v0.2.4)
112
+
||| - `aarch64``.a` from [0.4.15](https://github.com/pact-foundation/pact-reference/releases/tag/libpact_ffi-v0.4.15)|
113
+
||| - `.so` from [0.4.17](https://github.com/pact-foundation/pact-reference/releases/tag/libpact_ffi-v0.4.17)||
It's possible to make it work, but we make no guarantees and it's likely to [break](https://ariadne.space/2021/08/26/there-is-no-such-thing-as-a-glibc-based-alpine-image/) in subtle ways and we would instead recommend adopting Ubuntu or Debian which supports linking to glibc.
121
+
#### Reference Image
122
+
123
+
Here is an example NodeJS container that can be used as a reference to create a working container for your example:
124
+
125
+
```bash
126
+
FROM node:20-alpine
127
+
128
+
WORKDIR /app
129
+
130
+
COPY package*.json /app/
131
+
RUN npm install
132
+
COPY . /app/
133
+
134
+
RUN npm test
135
+
```
84
136
85
137
#### For Pact implementations that use the [Ruby shared core](roadmap/feature_support)
86
138
:::info
87
-
**Applicable languages**: Pact PHP, Python
139
+
**Applicable languages**: Python
88
140
:::
89
141
90
142
You'll need to ensure the following dependencies are met:
91
143
92
-
* Bash \(it's not enough to have Ash\)
93
144
* Standard CAs for TLS network communication
94
145
* glibc (>= 2.17)
95
146
@@ -100,14 +151,7 @@ _NOTE_: You do not need to install Ruby. The distribution takes care of this for
100
151
Here is an example NodeJS container that can be used as a reference to create a working container for your example:
101
152
102
153
```bash
103
-
FROM node:8-alpine
104
-
105
-
RUN apk add --no-cache --virtual build-dependencies build-base
106
-
107
-
RUN apk --no-cache add ca-certificates wget bash \
0 commit comments