-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker image support and misc. improvements (#1439)
- Loading branch information
Showing
8 changed files
with
287 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Test Docker Image | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
jobs: | ||
test-cross-platform-image: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- # Add support for more platforms with QEMU (optional) | ||
# https://github.com/docker/setup-qemu-action | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Read VERSION file | ||
id: getversion | ||
run: echo "::set-output name=version::$(grep -v '^\#' ./release-version)" | ||
- name: Build | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
# Currently github action runner only supports linux/amd64, it take a lot of time to build multi-arch image. | ||
# So we only build amd64 image for now. | ||
platforms: linux/amd64 | ||
push: false | ||
tags: pingcap/tidb-dashboard:${{ steps.getversion.outputs.version }} | ||
no-cache: false | ||
pull: false | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM golang:1.18-alpine3.16 as builder | ||
|
||
RUN apk add --no-cache \ | ||
make \ | ||
git \ | ||
bash \ | ||
curl \ | ||
findutils \ | ||
gcc \ | ||
libc-dev \ | ||
nodejs \ | ||
npm \ | ||
openjdk11 | ||
|
||
RUN npm install -g pnpm | ||
|
||
RUN mkdir -p /go/src/github.com/pingcap/tidb-dashboard/ui | ||
WORKDIR /go/src/github.com/pingcap/tidb-dashboard | ||
|
||
# Cache go module dependencies. | ||
COPY go.mod . | ||
COPY go.sum . | ||
RUN GO111MODULE=on go mod download | ||
|
||
# Cache npm dependencies. | ||
WORKDIR /go/src/github.com/pingcap/tidb-dashboard/ui | ||
COPY ui/pnpm-lock.yaml . | ||
RUN pnpm fetch | ||
|
||
# Build. | ||
WORKDIR /go/src/github.com/pingcap/tidb-dashboard | ||
COPY . . | ||
RUN make package PNPM_INSTALL_TAGS=--offline | ||
|
||
FROM alpine:3.16 | ||
|
||
COPY --from=builder /go/src/github.com/pingcap/tidb-dashboard/bin/tidb-dashboard /tidb-dashboard | ||
|
||
EXPOSE 12333 | ||
|
||
ENTRYPOINT ["/tidb-dashboard"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
version: '2' | ||
|
||
services: | ||
tidb-dashboard: | ||
image: pingcap/tidb-dashboard:nightly | ||
ports: | ||
- "12333:12333" | ||
command: | ||
- --pd=http://pd:2379 | ||
- --debug | ||
- --experimental | ||
- --feature-version=6.3.0 | ||
- --host=0.0.0.0 | ||
depends_on: | ||
- "pd" | ||
restart: on-failure | ||
pd: | ||
image: pingcap/pd:v6.3.0 | ||
ports: | ||
- "2379:2379" | ||
command: | ||
- --name=pd | ||
- --client-urls=http://0.0.0.0:2379 | ||
- --peer-urls=http://0.0.0.0:2380 | ||
- --advertise-client-urls=http://pd:2379 | ||
- --advertise-peer-urls=http://pd:2380 | ||
- --initial-cluster=pd=http://pd:2380 | ||
restart: on-failure | ||
tikv: | ||
image: pingcap/tikv:v6.3.0 | ||
ports: | ||
- "20180:20180" | ||
command: | ||
- --addr=0.0.0.0:20160 | ||
- --advertise-addr=tikv:20160 | ||
- --status-addr=0.0.0.0:20180 | ||
- --pd=pd:2379 | ||
depends_on: | ||
- "pd" | ||
restart: on-failure | ||
tidb: | ||
image: pingcap/tidb:v6.3.0 | ||
ports: | ||
- "4000:4000" | ||
- "10080:10080" | ||
command: | ||
- --host=0.0.0.0 | ||
- --advertise-address=tidb | ||
- --store=tikv | ||
- --path=pd:2379 | ||
depends_on: | ||
- "tikv" | ||
restart: on-failure | ||
tiflash: | ||
image: pingcap/tiflash:v6.3.0 | ||
volumes: | ||
- ./tiflash.toml:/tiflash.toml:ro | ||
ports: | ||
- "9000:9000" | ||
- "8123:8123" | ||
- "8234:8234" | ||
- "3930:3930" | ||
- "20170:20170" | ||
- "20292:20292" | ||
command: | ||
- --config=/tiflash.toml | ||
depends_on: | ||
- "tikv" | ||
- "tidb" | ||
restart: on-failure | ||
error-metric-trigger: | ||
image: mariadb:10.6.5 | ||
command: | ||
- mysql | ||
- -uroot | ||
- -htidb | ||
- -P4000 | ||
- -e | ||
- "select * from foo.bar;" | ||
depends_on: | ||
- "tikv" | ||
- "tidb" | ||
- "tiflash" | ||
restart: on-failure |
Oops, something went wrong.