diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml new file mode 100644 index 00000000..fa583691 --- /dev/null +++ b/.github/workflows/build_docker.yml @@ -0,0 +1,38 @@ +name: build docker + +on: + pull_request: + branches: + - build + push: + branches: + - build + +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:latest \ 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