Skip to content

rework osquery version in dockerfile #6

rework osquery version in dockerfile

rework osquery version in dockerfile #6

name: Build and Push Images
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
service:
# Each object in this list represents one image to build
# Adjust paths if your Dockerfiles differ
- name: osctrl-tls
file: ./deploy/cicd/docker/Dockerfile-osctrl-tls
- name: osctrl-admin
file: ./deploy/cicd/docker/Dockerfile-osctrl-admin
- name: osctrl-api
file: ./deploy/cicd/docker/Dockerfile-osctrl-api
- name: osctrl-cli
file: ./deploy/cicd/docker/Dockerfile-osctrl-cli
- name: osctrl-osquery
file: ./deploy/docker/dockerfiles/Dockerfile-osquery
# If you want to build the dev images, replace the file paths with e.g.:
# ./deploy/docker/dockerfiles/Dockerfile-dev-tls, etc.
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Optional: Set up Go if you need to run 'go build' or 'make' steps before Docker build
# - name: Set up Go
# uses: actions/setup-go@v5
# with:
# go-version: "stable"
- name: Build and Push ${{ matrix.service.name }}
uses: docker/build-push-action@v6
with:
context: .
# The key line: specify the correct Dockerfile path from the matrix
file: ${{ matrix.service.file }}
push: true
platforms: linux/amd64,linux/arm64
# Tag each image with both "latest" and the commit SHA
tags: |
ghcr.io/portswigger-it/${{ matrix.service.name }}:latest
ghcr.io/portswigger-it/${{ matrix.service.name }}:${{ github.sha }}
# If you want build-args, add them here (example shown)
# build-args: |
# GOLANG_VERSION=1.20
# OSQUERY_VERSION=5.7.0
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max