From a106cab80d50efab94b3f4ede6e57cb38fab970d Mon Sep 17 00:00:00 2001 From: deniszh Date: Mon, 22 Feb 2021 11:54:35 +0100 Subject: [PATCH 1/4] Trying to fix S390 --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c2a2731..281849a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,6 @@ RUN true \ && apk add --update --no-cache \ cairo \ cairo-dev \ - collectd \ - collectd-disk \ - collectd-nginx \ findutils \ librrd \ logrotate \ @@ -34,6 +31,11 @@ RUN true \ /var/log/carbon \ /var/log/graphite +# optional packages (e.g. not exist on S390) +RUN apk add --update \ + collectd collectd-disk collectd-nginx \ + || true + FROM base as build LABEL maintainer="Denys Zhdanov " From f9517df5f2428a5668a736a4bb56663d5c536f1a Mon Sep 17 00:00:00 2001 From: deniszh Date: Mon, 22 Feb 2021 11:58:28 +0100 Subject: [PATCH 2/4] Enable workflow on master --- .github/workflows/master-publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/master-publish.yml b/.github/workflows/master-publish.yml index e319b44..c116a70 100644 --- a/.github/workflows/master-publish.yml +++ b/.github/workflows/master-publish.yml @@ -3,6 +3,8 @@ name: Build master on: push: branches: [ master ] + pull_request: + branches: [ master ] env: PYPY_IMAGE: jamiehewland/alpine-pypy:3.6-7.3-alpine3.11 From cabbfa811f1179b9b8468f1d2af3f4a2dd012884 Mon Sep 17 00:00:00 2001 From: deniszh Date: Mon, 22 Feb 2021 13:13:13 +0100 Subject: [PATCH 3/4] Make go-carbon also optional --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 281849a..33223ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ RUN true \ /var/log/carbon \ /var/log/graphite -# optional packages (e.g. not exist on S390) +# optional packages (e.g. not exist on S390 in alpine 3.13 yet) RUN apk add --update \ collectd collectd-disk collectd-nginx \ || true @@ -115,7 +115,7 @@ RUN git clone "${statsd_repo}" \ && git checkout tags/v"${statsd_version}" \ && npm install -# build go-carbon (experimental) +# build go-carbon (optional) # https://github.com/go-graphite/go-carbon/pull/340 ARG gocarbon_version=0.15.6 ARG gocarbon_repo=https://github.com/go-graphite/go-carbon.git @@ -124,7 +124,8 @@ RUN git clone "${gocarbon_repo}" /usr/local/src/go-carbon \ && git checkout tags/v"${gocarbon_version}" \ && make \ && chmod +x go-carbon && mkdir -p /opt/graphite/bin/ \ - && cp -fv go-carbon /opt/graphite/bin/go-carbon + && cp -fv go-carbon /opt/graphite/bin/go-carbon \ + || true # install brubeck (experimental) ARG brubeck_version=bc1f4d3debe5eec337e7d132d092968ad17b91db From 5e5162b5a8802ebb3b03ec0041eb2434861d3769 Mon Sep 17 00:00:00 2001 From: deniszh Date: Mon, 22 Feb 2021 14:03:43 +0100 Subject: [PATCH 4/4] Reverting master workflow --- .github/workflows/master-publish.yml | 52 +++++++++++++--------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/.github/workflows/master-publish.yml b/.github/workflows/master-publish.yml index 52cee8f..e319b44 100644 --- a/.github/workflows/master-publish.yml +++ b/.github/workflows/master-publish.yml @@ -3,8 +3,6 @@ name: Build master on: push: branches: [ master ] - pull_request: - branches: [ master ] env: PYPY_IMAGE: jamiehewland/alpine-pypy:3.6-7.3-alpine3.11 @@ -21,31 +19,31 @@ jobs: platforms: all # Buildx provides an easier way of building Docker images for other architectures - uses: docker/setup-buildx-action@master - - name: Build s390 python3 image + - name: Build amd64 python3 image + run: | + docker buildx build --platform=linux/amd64 --load -t graphiteapp/graphite-statsd:master . + - name: Run Snyk to check amd64 python3 image for vulnerabilities + uses: snyk/actions/docker@master + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + command: monitor + image: graphiteapp/graphite-statsd:master + args: --file=Dockerfile --platform=linux/amd64 --project-name=graphite-project/docker-graphite-statsd + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push amd64 python3 image to Docker Hub + run: | + docker buildx build --platform=linux/amd64 --push -t graphiteapp/graphite-statsd:master . + - name: Build and push amd64 pypy image to Docker Hub run: | - docker buildx build --platform=linux/s390x --load -t graphiteapp/graphite-statsd:master . -# - name: Run Snyk to check amd64 python3 image for vulnerabilities -# uses: snyk/actions/docker@master -# env: -# SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} -# with: -# command: monitor -# image: graphiteapp/graphite-statsd:master -# args: --file=Dockerfile --platform=linux/amd64 --project-name=graphite-project/docker-graphite-statsd -# - name: Login to DockerHub -# uses: docker/login-action@v1 -# with: -# username: ${{ secrets.DOCKER_USERNAME }} -# password: ${{ secrets.DOCKER_PASSWORD }} -# - name: Build and push amd64 python3 image to Docker Hub + docker buildx build --platform=linux/amd64 --build-arg BASEIMAGE=${PYPY_IMAGE} --build-arg python_binary=/usr/local/bin/pypy3 --push -t graphiteapp/graphite-statsd:master-pypy . +# - name: Login to ghcr.io # run: | -# docker buildx build --platform=linux/amd64 --push -t graphiteapp/graphite-statsd:master . -# - name: Build and push amd64 pypy image to Docker Hub +# echo "${{ secrets.GHCR_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin +# - name: Build and push amd64 pypy image to ghcr.io # run: | -# docker buildx build --platform=linux/amd64 --build-arg BASEIMAGE=${PYPY_IMAGE} --build-arg python_binary=/usr/local/bin/pypy3 --push -t graphiteapp/graphite-statsd:master-pypy . -## - name: Login to ghcr.io -## run: | -## echo "${{ secrets.GHCR_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin -## - name: Build and push amd64 pypy image to ghcr.io -## run: | -## docker buildx build --platform=linux/amd64 --build-arg BASEIMAGE=${PYPY_IMAGE} --build-arg python_binary=/usr/local/bin/pypy3 --push -t ghcr.io/graphite-project/graphite-statsd:test-pypy . +# docker buildx build --platform=linux/amd64 --build-arg BASEIMAGE=${PYPY_IMAGE} --build-arg python_binary=/usr/local/bin/pypy3 --push -t ghcr.io/graphite-project/graphite-statsd:test-pypy .