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: docs/secure-connections/sauce-connect-5/installation/docker.md
+11-47Lines changed: 11 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,58 +43,22 @@ Here are some benefits/use cases for using containerized Sauce Connect Proxy:
43
43
--network="host" \
44
44
-it saucelabs/sauce-connect:5.0
45
45
```
46
+
If desired, you can specify any additional [`sc run` options](/dev/cli/sauce-connect-5/run/) as environment variables.
46
47
47
-
If desired, you can specify any additional ["sc run" CLI arguments](/dev/cli/sauce-connect-5/run/).
48
+
Alternatively, you can also mount a config file to the container by adding the `-v` option to the `docker run` command.
48
49
49
-
:::note
50
-
The example above uses `--network="host"` docker option to allow Sauce Connect in the Docker container to access your local services in the host machine. This option does not work on MacOS and Windows. See [Connect from a container to a service on the macOS host](https://docs.docker.com/desktop/networking/#use-cases-and-workarounds) for more details.
51
-
:::
52
-
53
-
## Running the Sauce Connect Docker Container with a CI/CD Pipeline
54
-
55
-
If you want to run this Docker image as part of your CI/CD pipeline, you would need a way to determine that Sauce Connect Proxy is ready to proxy the requests. You can achieve that by:
56
-
57
-
- Using the `/readyz` endpoint, available with the Sauce Connect Proxy [internal API server](/secure-connections/sauce-connect-5/operation/monitoring/#local-api-server).
58
-
59
-
### Readiness Endpoint
60
-
61
-
The readiness endpoint allows you to configure liveness and readiness HTTP probes. See the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) for more information.
62
-
63
-
Docker container exposes Sauce Connect Proxy [API server](/secure-connections/sauce-connect-5/operation/monitoring/#local-api-server) on port 8032. The readiness endpoint `/readyz` returns 200 response code when Sauce Connect Proxy is ready, 503 otherwise.
64
-
65
-
You can leverage the readiness endpoint in your CI/CD pipeline by running the following:
66
-
67
-
1. Create a bash script `wait-for-sc.sh` that will ensure the pipeline only continues after Sauce Connect Proxy is fully connected and ready.
68
-
69
-
```bash title="wait-for-sc.sh"
70
-
timeout=45
71
-
i=0
72
-
until [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8032/readyz)"=="200" ]
73
-
do
74
-
let"++i"
75
-
if [ $i-gt$timeout ];then
76
-
echo"Timed out after $i seconds waiting for Sauce Connect readiness, exiting..."
1. Run Sauce Connect Docker container using the script below. It is important that you map port 8032 (that is, `-p 8032:8032`) so that the port is available to the host.
57
+
See [Sauce Connect Proxy Readiness Checks](/secure-connections/sauce-connect-5/operation/readiness-checks) for more information on how to check if the tunnel is ready to accept jobs.
85
58
86
-
```bash
87
-
$ docker run \
88
-
--detach \
89
-
-e SAUCE_USERNAME=${SAUCE_USERNAME} \
90
-
-e SAUCE_ACCESS_KEY=${SAUCE_ACCESS_KEY} \
91
-
-e SAUCE_REGION=${SAUCE_REGION} \
92
-
-e SAUCE_TUNNEL_NAME=${SAUCE_TUNNEL_NAME} \
93
-
-p 8032:8032 \
94
-
-t saucelabs/sauce-connect:5.0 \
95
-
-i your-docker-tunnel
96
-
$ ./wait-for-sc.sh
97
-
```
59
+
:::note
60
+
The example above uses `--network="host"` docker option to allow Sauce Connect in the Docker container to access your local services in the host machine. This option does not work on MacOS and Windows. See [Connect from a container to a service on the macOS host](https://docs.docker.com/desktop/networking/#use-cases-and-workarounds) for more details.
0 commit comments