From 11ba5a6bb7a2f1816f4f2a99f7bccb87723b8da8 Mon Sep 17 00:00:00 2001 From: CelestaLiu Date: Tue, 5 Aug 2025 12:51:54 +0000 Subject: [PATCH] add support for tidb with nightly images --- config.json | 2 +- tidb/Dockerfile | 25 +++++++++++++++++++++++++ tidb/__init__.py | 0 tidb/config.json | 13 +++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 tidb/Dockerfile create mode 100644 tidb/__init__.py create mode 100644 tidb/config.json diff --git a/config.json b/config.json index fb72cec..4a8cc01 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "dbms_list": ["mysql", "postgres", "sqlite"], + "dbms_list": ["mysql", "postgres", "sqlite", "tidb"], "dbms": "mysql", "container_name": "mysql-custom", "image": "mysql-custom", diff --git a/tidb/Dockerfile b/tidb/Dockerfile new file mode 100644 index 0000000..a9f764f --- /dev/null +++ b/tidb/Dockerfile @@ -0,0 +1,25 @@ + + FROM golang:1.23 AS builder + + ARG TIDB_VERSION=master + ENV TIDB_VERSION=${TIDB_VERSION} + + WORKDIR /go/src/github.com/pingcap + + + RUN git clone --depth=1 --branch=${TIDB_VERSION} https://github.com/pingcap/tidb.git + + WORKDIR /go/src/github.com/pingcap/tidb + + + RUN make + + + FROM debian:bookworm-slim + + WORKDIR /tidb + COPY --from=builder /go/src/github.com/pingcap/tidb/bin/tidb-server . + + EXPOSE 4000 + ENTRYPOINT ["./tidb-server"] + \ No newline at end of file diff --git a/tidb/__init__.py b/tidb/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tidb/config.json b/tidb/config.json new file mode 100644 index 0000000..40c5b15 --- /dev/null +++ b/tidb/config.json @@ -0,0 +1,13 @@ +{ + "embedded": "no", + "dbms": "tidb", + "image": "pingcap/tidb:nightly", + "container_name": "tidb-sqlancer", + "port": 4000, + "username": "root", + "password": "", + "oracle": "WHERE", + "num_threads": 4, + "timeout_seconds": 60 + } + \ No newline at end of file