Skip to content

Commit

Permalink
chore: add platforms to docker images (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demonsthere authored Oct 25, 2024
1 parent 574ffb0 commit 297ff1e
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-and-scan/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
load: true

- name: Anchore Scanner
uses: anchore/scan-action@v3
uses: anchore/scan-action@v5
if: always()
id: grype-scan
with:
Expand Down
29 changes: 17 additions & 12 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,24 @@ jobs:
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Login to DockerHub
if: github.event_name != 'pull_request'
release:
if: github.ref_type == 'tag'
needs:
- docker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: arekkas
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_SECRET_AREKKAS }}

- name: Push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v5
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
context: ./docker
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
distribution: goreleaser
version: latest
args: release --clean
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
46 changes: 46 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: k8s-toolbox
version: 2

snapshot:
version_template: "{{ .Tag }}-next"

# changelog:
# sort: asc
# use: github-native

builds:
- skip: true

dockers:
- image_templates:
- "oryd/{{ .ProjectName }}:{{ .Tag }}-amd64"
- "oryd/{{ .ProjectName }}:{{ .ShortCommit }}-amd64"
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
dockerfile: "docker/Dockerfile"
- image_templates:
- "oryd/{{ .ProjectName }}:{{ .Tag }}-arm64"
- "oryd/{{ .ProjectName }}:{{ .ShortCommit }}-arm64"
goarch: arm64
build_flag_templates:
- "--platform=linux/arm64"
dockerfile: "docker/Dockerfile"

docker_manifests:
- name_template: "oryd/{{ .ProjectName }}:{{ .Tag }}"
id: "tag"
image_templates:
- "oryd/{{ .ProjectName }}:{{ .Tag }}-amd64"
- "oryd/{{ .ProjectName }}:{{ .Tag }}-arm64"
- name_template: "oryd/{{ .ProjectName }}:latest"
id: "latest"
image_templates:
- "oryd/{{ .ProjectName }}:{{ .Tag }}-amd64"
- "oryd/{{ .ProjectName }}:{{ .Tag }}-arm64"

release:
prerelease: auto
name_template: "{{ .Tag }}"
6 changes: 1 addition & 5 deletions .grype.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
ignore:
# false positive: https://github.com/anchore/grype/issues/558
- vulnerability: CVE-2015-5237
# false positive: https://github.com/anchore/grype/issues/558
- vulnerability: CVE-2021-22570
ignore: []
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM alpine:3.20

ARG USER=ory
ENV HOME /home/$USER
ENV JQ_VERSION 1.7.1
ENV KUBECTL_VERSION 1.31.2
ENV HOME=/home/$USER
ENV JQ_VERSION=1.7.1
ENV KUBECTL_VERSION=1.31.2

RUN apk add --no-cache --update-cache --upgrade --latest \
ca-certificates curl netcat-openbsd coreutils bash inotify-tools procps
Expand Down

0 comments on commit 297ff1e

Please sign in to comment.