Skip to content

Commit 3abc397

Browse files
authored
Merge pull request #39 from ethpandaops/fix/linux-docker-network-proto-gen
fix: enable proto generation on Linux with Docker network support
2 parents a5c2f4f + c82dbbf commit 3abc397

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,14 @@ run: build-binary
224224
if echo "$$NATIVE_DSN" | grep -q "^https://"; then \
225225
NATIVE_DSN="$$NATIVE_DSN?secure=true"; \
226226
fi; \
227-
NETWORK_FLAG=""; \
227+
NETWORK_FLAG="--add-host=host.docker.internal:host-gateway"; \
228+
CLICKHOUSE_HOSTNAME="host.docker.internal"; \
228229
if echo "$$NATIVE_DSN" | grep -Eq "localhost|127\.0\.0\.1"; then \
229-
NATIVE_DSN=$$(echo "$$NATIVE_DSN" | sed 's|localhost|host.docker.internal|g' | sed 's|127\.0\.0\.1|host.docker.internal|g'); \
230+
if docker network ls --format '{{.Name}}' | grep -q '^xatu_xatu-net$$'; then \
231+
NETWORK_FLAG="--network xatu_xatu-net"; \
232+
CLICKHOUSE_HOSTNAME="xatu-cbt-clickhouse-01"; \
233+
fi; \
234+
NATIVE_DSN=$$(echo "$$NATIVE_DSN" | sed "s|localhost|$$CLICKHOUSE_HOSTNAME|g" | sed "s|127\.0\.0\.1|$$CLICKHOUSE_HOSTNAME|g"); \
230235
fi; \
231236
docker pull ethpandaops/clickhouse-proto-gen:latest; \
232237
docker run --rm -v "$$(pwd):/workspace" \

0 commit comments

Comments
 (0)