Skip to content

Commit

Permalink
Add Docker images for arm, arm64, ppc64le and s390x
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Sep 14, 2021
1 parent c2da400 commit c2c966e
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 22 deletions.
12 changes: 0 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ jobs:
- run: ./ci/install_gcc4.8.sh
- run: ./ci/install_opentracing.sh
- run: ./ci/do_ci.sh build
docker_image:
machine:
image: ubuntu-2004:202107-02
environment:
DOCKER_BUILDKIT: 1
steps:
- checkout
- run:
command: docker build -t opentracing/nginx-opentracing --target final .
openresty_docker_image:
machine: true
steps:
Expand Down Expand Up @@ -131,9 +122,6 @@ workflows:
- build_gcc48_opentracing_16:
requires:
- build_gcc48_opentracing_15
- docker_image:
requires:
- system_testing
- openresty_docker_image:
requires:
- system_testing
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ updates:
directory: "/"
schedule:
interval: daily
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
75 changes: 75 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Docker

on:
push:
branches:
- master
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- master

env:
PLATFORMS: "linux/arm,linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"

jobs:
build-docker:
name: Build Docker Image
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Output Variables
id: var
run: |
echo "::set-output name=nginx_version::$(grep -m1 'FROM nginx:' <Dockerfile | awk -F'[: ]' '{print $3}')"
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: arm64,ppc64le
if: github.event_name != 'pull_request'

- name: Docker Buildx
uses: docker/setup-buildx-action@v1

- name: DockerHub Login
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: github.event_name != 'pull_request'

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: opentracing/nginx-opentracing
tags: |
type=edge
type=ref,event=pr
type=semver,pattern={{version}}
type=raw,value=nginx-${{ steps.var.outputs.nginx_version }},enable=${{ contains(github.ref, 'refs/tags/') }}
- name: Build (and push if not PR)
uses: docker/build-push-action@v2
with:
pull: true
load: ${{ github.event_name == 'pull_request' }}
push: ${{ github.event_name != 'pull_request' }}
platforms: ${{ github.event_name != 'pull_request' && env.PLATFORMS || '' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
target: final
10 changes: 0 additions & 10 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ elif [[ "$1" == "push_docker_image" ]]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
VERSION_TAG="$(git describe --abbrev=0 --tags)"
VERSION="${VERSION_TAG/v/}"
# nginx
docker build -t opentracing/nginx-opentracing --target final .
docker tag opentracing/nginx-opentracing opentracing/nginx-opentracing:${VERSION}
docker push opentracing/nginx-opentracing:${VERSION}
docker tag opentracing/nginx-opentracing opentracing/nginx-opentracing:latest
docker push opentracing/nginx-opentracing:latest

NGINX_VERSION="$(grep -m1 'FROM nginx:' <Dockerfile | awk -F'[: ]' '{print $3}')"
docker tag opentracing/nginx-opentracing opentracing/nginx-opentracing:nginx-${NGINX_VERSION}
docker push opentracing/nginx-opentracing:nginx-${NGINX_VERSION}

# openresty
docker build -t opentracing/openresty -f Dockerfile-openresty .
Expand Down

0 comments on commit c2c966e

Please sign in to comment.