Skip to content

Commit 80d3118

Browse files
committed
fix(container): Add container env, polish doc
1 parent a16b944 commit 80d3118

3 files changed

Lines changed: 13 additions & 16 deletions

File tree

build/Dockerfile.videxserver

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# Thanks to Daniel Black for providing a great packaging example.
2-
3-
41
FROM python:3.9-slim
52

63
ENV PYTHONDONTWRITEBYTECODE=1 \
74
PYTHONUNBUFFERED=1 \
85
PIP_DISABLE_PIP_VERSION_CHECK=1 \
96
PIP_NO_CACHE_DIR=1 \
7+
VIDEX_CONTAINER=1 \
108
PYTHONPATH=/opt/videx/src
119

1210
WORKDIR /opt/videx

build/videx_container_entrypoint.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#!/usr/bin/env python3
21
"""
3-
VIDEX Docker entrypoint.
2+
VIDEX container entrypoint.
43
54
This entrypoint provides two modes:
65
- `server`: start the long-running VIDEX stats server (default)
@@ -28,6 +27,10 @@ def _in_container_best_effort() -> bool:
2827
Best-effort heuristics to detect container environment.
2928
Used only for warnings (never for rewriting args or failing).
3029
"""
30+
explicit = os.environ.get("VIDEX_CONTAINER")
31+
if explicit and explicit.strip().lower() not in {"0", "false", "no"}:
32+
return True
33+
3134
if os.path.exists("/.dockerenv"):
3235
return True
3336

@@ -124,8 +127,8 @@ def _maybe_warn_localhost_target(argv: List[str]) -> None:
124127

125128
sys.stderr.write(
126129
"Warning: You may be running in a container, but the `--target` parameter is configured with 127.0.0.1/localhost.\n"
127-
" In Docker, localhost usually refers to the container itself.\n"
128-
" If your MariaDB/VIDEX runs on the Docker host, this may fail.\n\n"
130+
" In a container, localhost usually refers to the container itself.\n"
131+
" If your MariaDB/VIDEX runs on the host machine, this may fail.\n\n"
129132
"Suggestions:\n"
130133
" - Docker Desktop (Mac/Windows): try host.docker.internal in --target.\n"
131134
" - Linux Docker Engine: add this when running the container:\n"

doc/VIDEX_SERVER_DOCKER.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22

33
The latest public image is:
44

5-
- `kangrongme/videx-server:0.2.0` (Docker Hub)
6-
7-
Make sure your environment can reach Docker Hub. If Docker Hub is not accessible but GHCR is, use:
8-
9-
- `ghcr.io/kr11/videx-server:0.2.0`
5+
- `ghcr.io/bytedance/videx-server:0.2.0-preview-test1` (GHCR)
106

117
This image supports two entrypoint modes:
128

@@ -42,7 +38,7 @@ Expose container port `5001` to a host port (choose any free host port, like 500
4238
```bash
4339
docker run -d --name videx-server \
4440
-p 5001:5001 \
45-
kangrongme/videx-server:0.2.0
41+
ghcr.io/bytedance/videx-server:0.2.0-preview-test1
4642
```
4743

4844
Then open:
@@ -60,7 +56,7 @@ Then open:
6056

6157
```bash
6258
docker run --rm --name videx-sync \
63-
kangrongme/videx-server:0.2.0 sync \
59+
ghcr.io/bytedance/videx-server:0.2.0-preview-test1 sync \
6460
--target <TARGET_HOST>:<TARGET_PORT>:<TARGET_DB>:<TARGET_USER>:<TARGET_PASS> \
6561
[--videx <VIDEX_HOST>:<VIDEX_PORT>:<VIDEX_DB>:<VIDEX_USER>:<VIDEX_PASS>] \
6662
[--videx_server <VIDEX_SERVER_HOST>:<VIDEX_SERVER_PORT>]
@@ -80,7 +76,7 @@ Run:
8076

8177
```bash
8278
docker run --rm --name videx-sync \
83-
kangrongme/videx-server:0.2.0 sync \
79+
ghcr.io/bytedance/videx-server:0.2.0-preview-test1 sync \
8480
--target 203.0.113.42:15508:tpch_tiny:videx:password \
8581
--videx 203.0.113.42:15508:videx_tpch_tiny:videx:password \
8682
--videx_server 203.0.113.42:5001
@@ -110,7 +106,7 @@ Inside a container, `localhost/127.0.0.1` refers to the container itself. If Mar
110106
```bash
111107
docker run --rm --name videx-sync \
112108
--add-host=host.docker.internal:host-gateway \
113-
kangrongme/videx-server:0.2.0 sync \
109+
ghcr.io/bytedance/videx-server:0.2.0-preview-test1 sync \
114110
--target host.docker.internal:<PORT>:<DB>:<USER>:<PASS> \
115111
--videx host.docker.internal:<PORT>:<VIDEX_DB>:<VIDEX_USER>:<VIDEX_PASS> \
116112
--videx_server host.docker.internal:<VIDEX_SERVER_PORT>

0 commit comments

Comments
 (0)