chore: add github workflow for docker

This commit is contained in:
He Wang 2023-10-13 16:11:49 +08:00
parent cf7d59372b
commit cb076729fe
No known key found for this signature in database
GPG Key ID: 2FE68C963D26DBF3

30
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Docker
on:
push:
paths:
- .github/workflows/docker.yml
- tools/docker
pull_request:
paths:
- .github/workflows/docker.yml
- tools/docker
jobs:
standalone:
name: Standalone
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Docker Image
run: |
cd tools/docker/standalone
docker build --build-arg VERSION=4.2.1.0-100000102023092807 -t oceanbase-ce .
- name: Boot Docker Container
timeout-minutes: 5
run: |
docker run --name ob-slim -p 2881:2881 -e MODE=slim -d oceanbase-ce
eval 'while ! docker logs ob-slim | grep -q "boot success!"; do echo "booting..."; sleep 10; done'
echo "boot success!"
- name: Test Docker Container
run: docker exec ob-slim obclient -h127.0.0.1 -P2881 -uroot -e 'select version()'