Compare commits

...

2 Commits

Author SHA1 Message Date
Andrey Taranik
34ca0f4c33 compute docker image multi-platform buiild 2022-01-10 00:01:07 +03:00
Andrey Taranik
63923c1b4e build flow for zenithdb/build:buster 2022-01-09 18:16:54 +03:00
2 changed files with 58 additions and 11 deletions

View File

@@ -443,25 +443,27 @@ jobs:
- checkout - checkout
- setup_remote_docker: - setup_remote_docker:
docker_layer_caching: true docker_layer_caching: true
- run:
name: Login to docker hub
command: echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
- run:
name: Setup buildx
command: docker run -it --rm --privileged tonistiigi/binfmt --install all
# Build zenithdb/compute-tools:latest image and push it to Docker hub # Build zenithdb/compute-tools:latest image and push it to Docker hub
# TODO: this should probably also use versioned tag, not just :latest. # TODO: this should probably also use versioned tag, not just :latest.
# XXX: but should it? We build and use it only locally now. # XXX: but should it? We build and use it only locally now.
- run: - run:
name: Build and push compute-tools Docker image name: Build and push compute-tools Docker image
command: | command: docker buildx build --platform linux/amd64,linux/arm64 --push -t zenithdb/compute-tools:latest compute_tools
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
docker build -t zenithdb/compute-tools:latest ./compute_tools/
docker push zenithdb/compute-tools:latest
- run: - run:
name: Init postgres submodule name: Init postgres submodule
command: git submodule update --init --depth 1 command: git submodule update --init --depth 1
- run: - run:
name: Build and push compute-node Docker image name: Build and push compute-node Docker image
command: | command: |
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
DOCKER_TAG=$(git log --oneline|wc -l) DOCKER_TAG=$(git log --oneline|wc -l)
docker build -t zenithdb/compute-node:latest vendor/postgres && docker push zenithdb/compute-node:latest docker buildx build --platform linux/amd64,linux/arm64 --push -t zenithdb/compute-node:latest vendor/postgres
docker tag zenithdb/compute-node:latest zenithdb/compute-node:${DOCKER_TAG} && docker push zenithdb/compute-node:${DOCKER_TAG} docker buildx build --platform linux/amd64,linux/arm64 --push -t zenithdb/compute-node:${DOCKER_TAG} vendor/postgres
deploy-staging: deploy-staging:
docker: docker:
@@ -688,10 +690,11 @@ workflows:
branches: branches:
only: only:
- main - main
requires: - docker-multi-platform
- pg_regress-tests-release # requires:
- other-tests-release # - pg_regress-tests-release
- compute-tools-test # - other-tests-release
# - compute-tools-test
- deploy-staging: - deploy-staging:
# Context gives an ability to login # Context gives an ability to login
context: Docker Hub context: Docker Hub

44
.github/workflows/docker-builder.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
## Build docker image zenithdb/build:buster for linux/adm64 and linux/arm64 platforms
name: docker-builder
on:
push:
branches:
- 'docker-multi-platform'
schedule:
# * is a special character in YAML so you have to quote this string
# buil daily at 5:30am
- cron: '30 5 * * *'
jobs:
docker-builder-buster:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
submodules: false
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
-
name: Build and push zenithdb/build:buster
uses: docker/build-push-action@v2
with:
push: true
file: Dockerfile.build
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=zenithdb/build:buster
tags: zenithdb/build:buster