diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..e35dfc0 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,40 @@ +name: docker + +on: + push: + branches: + - master + +defaults: + run: + shell: bash + +jobs: + docker: + name: docker + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: + - {"name": "centos7", "version": 7, "file": "centos"} + - {"name": "centos8", "version": 8, "file": "centos"} + - {"name": "ubuntu1604", "version": "xenial", "file": "ubuntu"} + - {"name": "ubuntu1804", "version": "bionic", "file": "ubuntu"} + - {"name": "ubuntu2004", "version": "focal", "file": "ubuntu"} + steps: + - uses: actions/checkout@v1 + - uses: docker/setup-qemu-action@v1 + - uses: docker/setup-buildx-action@v1 + - uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile.${{ matrix.os.file }} + platforms: linux/amd64,linux/arm64 + tags: vesoft/nebula-dev:${{ matrix.os.name }} + push: true + build-args: VERSION=${{ matrix.os.version }} diff --git a/Dockerfile.centos b/Dockerfile.centos index 21b1b1a..dd80f67 100644 --- a/Dockerfile.centos +++ b/Dockerfile.centos @@ -39,7 +39,7 @@ RUN yum update -y && yum install -y epel-release \ wget \ xz \ zlib-devel \ -# client + # client libatomic \ && yum clean all \ && rm -rf /var/cache/yum @@ -76,15 +76,13 @@ RUN wget -qO- https://github.com/git/git/archive/v2.25.0.tar.gz | tar zxf - -C . && make -j$(nproc) && make install \ && cd ../ && rm -rf git-2.25.0 -# Install nebula third-party 1.0 -RUN git clone --depth 1 --branch v1-head --single-branch https://github.com/vesoft-inc/nebula.git \ - && ./nebula/third-party/install-third-party.sh \ - && rm -rf nebula - -# Install nebula third-party 2.0 -RUN git clone --depth 1 --branch master --single-branch https://github.com/vesoft-inc/nebula-third-party.git \ - && ./nebula-third-party/install-third-party.sh \ - && rm -rf nebula-third-party +# Install nebula third-party 1.0 and 2.0 +RUN git clone https://github.com/vesoft-inc/nebula-third-party.git \ + && cd nebula-third-party \ + && ./install-third-party.sh \ + && git checkout v1.0 \ + && ./install-third-party.sh \ + && cd .. && rm -rf nebula-third-party # Install ccache RUN wget -qO- https://github.com/ccache/ccache/releases/download/v3.7.7/ccache-3.7.7.tar.gz | tar zxf - -C ./ \ diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index 89e9464..dc42e5a 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -67,15 +67,13 @@ RUN wget -qO- https://github.com/git/git/archive/v2.25.0.tar.gz | tar zxf - -C . && make -j$(nproc) && make install \ && cd ../ && rm -rf git-2.25.0 -# Install nebula third-party 1.0 -RUN git clone --branch v1-head --single-branch --depth 1 https://github.com/vesoft-inc/nebula.git \ - && ./nebula/third-party/install-third-party.sh \ - && rm -rf nebula - -# Install nebula third-party 2.0 -RUN git clone --depth 1 --branch master --single-branch https://github.com/vesoft-inc/nebula-third-party.git \ - && ./nebula-third-party/install-third-party.sh \ - && rm -rf nebula-third-party +# Install nebula third-party 1.0 and 2.0 +RUN git clone https://github.com/vesoft-inc/nebula-third-party.git \ + && cd nebula-third-party \ + && ./install-third-party.sh \ + && git checkout v1.0 \ + && ./install-third-party.sh \ + && cd .. && rm -rf nebula-third-party # Install ccache RUN wget -qO- https://github.com/ccache/ccache/releases/download/v3.7.7/ccache-3.7.7.tar.gz | tar zxf - -C ./ \ diff --git a/hooks/build b/hooks/build deleted file mode 100755 index 90732d9..0000000 --- a/hooks/build +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -VER=7 - -if [ "$DOCKER_TAG" = "centos6" ]; then - VER=6 -elif [ "$DOCKER_TAG" = "centos7" ]; then - VER=7 -elif [ "$DOCKER_TAG" = "centos8" ]; then - VER=8 -elif [ "$DOCKER_TAG" = "ubuntu1604" ]; then - VER=xenial -elif [ "$DOCKER_TAG" = "ubuntu1804" ]; then - VER=bionic -elif [ "$DOCKER_TAG" = "ubuntu2004" ]; then - VER=focal -fi - -docker build -t ${IMAGE_NAME} -f ${DOCKERFILE_PATH} --build-arg VERSION=${VER} .