Skip to content

Commit 68bee39

Browse files
committed
docs: Add linux docker networking fix
1 parent 7a0d04d commit 68bee39

File tree

1 file changed

+50
-3
lines changed

1 file changed

+50
-3
lines changed

docs/installation.mdx

+50-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ development and testing purposes._
1717

1818
### Required
1919

20-
- [Docker](https://docs.docker.com/get-docker/)
21-
- [Docker Compose](https://docs.docker.com/compose/install/)
20+
- [Docker](https://docs.docker.com/get-docker/) (Docker Engine v20.10+)
21+
- [Docker Compose](https://docs.docker.com/compose/install/) (Compose V2)
2222
- [ngrok](https://ngrok.com/)
2323
- [pnpm](https://pnpm.io/installation)
2424

@@ -110,6 +110,53 @@ If correctly set up, your .env should contain:
110110
TRACECAT__RUNNER_URL=https://your-ngrok-domain.ngrok-free.app
111111
```
112112

113+
### Linux users
114+
115+
If you are using Linux, you may encounter issues around being unable to resolve `host.docker.internal` from within the Docker containers.
116+
117+
To resolve this, you can add the following parameter to each of the services in the `docker-compose.yaml` file, as suggested by this [StackOverflow post](https://stackoverflow.com/a/67158212).
118+
119+
For example:
120+
121+
```yaml
122+
services:
123+
api:
124+
build: .
125+
container_name: api
126+
ports:
127+
- "8000:8000"
128+
volumes:
129+
- ./tracecat:/app/tracecat
130+
- app-storage:/var/lib/tracecat
131+
environment:
132+
API_MODULE: "tracecat.api.app:app"
133+
# Shared
134+
LOG_LEVEL: ${LOG_LEVEL}
135+
RABBITMQ_URI: ${RABBITMQ_URI}
136+
TRACECAT__APP_ENV: ${TRACECAT__APP_ENV}
137+
TRACECAT__DB_ENCRYPTION_KEY: ${TRACECAT__DB_ENCRYPTION_KEY}
138+
TRACECAT__DB_URI: ${TRACECAT__DB_URI}
139+
TRACECAT__SERVICE_KEY: ${TRACECAT__SERVICE_KEY}
140+
TRACECAT__SIGNING_SECRET: ${TRACECAT__SIGNING_SECRET}
141+
TRACECAT__API_URL: ${TRACECAT__API_URL}
142+
TRACECAT__RUNNER_URL: ${TRACECAT__RUNNER_URL}
143+
# Auth
144+
CLERK_FRONTEND_API_URL: ${CLERK_FRONTEND_API_URL}
145+
TRACECAT__DISABLE_AUTH: ${TRACECAT__DISABLE_AUTH}
146+
# Integrations
147+
OPENAI_API_KEY: ${OPENAI_API_KEY}
148+
restart: unless-stopped
149+
depends_on:
150+
rabbitmq:
151+
condition: service_healthy
152+
networks:
153+
- internal-network
154+
extra_hosts:
155+
- "host.docker.internal:host-gateway"
156+
# Do the same for the rest of the services
157+
# ...
158+
```
159+
113160
### Start Tracecat services
114161

115162
Finally, start Tracecat using `docker compose`:
@@ -166,4 +213,4 @@ This allows Docker containers to reference the Docker host machine.
166213

167214
For example, if you have a service `api` running in a container with port mapping `1234:8000` (mapping of port 1234 on the Docker host and 8000 in the container), from inside the Docker network you should be able to reference it using `http://api:8000`.
168215

169-
We are working on a more robust solution to this issue - we appreciate your patience!
216+
If you're using Linux, please refer to the [Linux users](#linux-users) section. On MacOS and Windows WSL, you shouldn't have this issue. If you do, please refer to the [Docker networking docs](https://docs.docker.com/network/) or reach out to us on [Discord](https://discord.gg/n3GF4qxFU8) for help.

0 commit comments

Comments
 (0)