From 752df5940c4fcb4f2b0a48896a40132e79bc60d7 Mon Sep 17 00:00:00 2001 From: Teingi Date: Thu, 7 Nov 2024 20:24:50 +0800 Subject: [PATCH] add obdiag build docker --- .github/workflows/build_base_docker.yml | 38 +++++++++++++++++++++++++ build/Dockerfile | 12 ++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/build_base_docker.yml create mode 100644 build/Dockerfile diff --git a/.github/workflows/build_base_docker.yml b/.github/workflows/build_base_docker.yml new file mode 100644 index 00000000..810a434f --- /dev/null +++ b/.github/workflows/build_base_docker.yml @@ -0,0 +1,38 @@ +name: build docker + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + build-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Create and push manifests w/o cache + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64 + file: build/Dockerfile + push: true + tags: | + ${{ vars.DOCKER_PUSH_BASE }}/oceanbase/obdiag-builder:0.1.0 \ No newline at end of file diff --git a/build/Dockerfile b/build/Dockerfile new file mode 100644 index 00000000..0f7753c6 --- /dev/null +++ b/build/Dockerfile @@ -0,0 +1,12 @@ +FROM centos:7 +RUN rm -rf /etc/yum.repos.d/* +RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo +RUN yum install -y wget rpm-build +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh --no-check-certificate +RUN sh Miniconda3-latest-Linux-x86_64.sh -p /opt/miniconda3 -b +RUN export PATH=/opt/miniconda3/bin:$PATH +RUN /opt/miniconda3/bin/conda init +RUN /opt/miniconda3/bin/conda create --name obdiag python=3.8 -y +RUN source /opt/miniconda3/bin/activate obdiag +RUN /opt/miniconda3/envs/obdiag/bin/python3.8 -m pip install --upgrade pip setuptools wheel +RUN yum install -y gcc gcc-c++ make \ No newline at end of file