Skip to content

Commit

Permalink
add build dockerfile (#535)
Browse files Browse the repository at this point in the history
* add build docker

* add build docker
  • Loading branch information
Teingi authored Nov 7, 2024
1 parent 3475e1f commit 42433f0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions build/DockerFile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 42433f0

Please sign in to comment.