Skip to content

Commit

Permalink
add ubuntu matrix to build images for multiple base os versions
Browse files Browse the repository at this point in the history
  • Loading branch information
rajrohanyadav committed Nov 14, 2024
1 parent 03274bd commit eee6cab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build_publish_builder_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
strategy:
matrix:
go-version: [1.22.9, 1.23.2, 1.23.3] # Create a matrix of Go versions to build images for
ubuntu-version: [16.04] # Create a matrix of Ubuntu versions to build images for

steps:
- name: Checkout repository
Expand Down Expand Up @@ -43,7 +44,8 @@ jobs:
file: build/Dockerfile
build-args: |
GO_VERSION=${{ matrix.go-version }}
UBUNTU_VERSION=${{ matrix.ubuntu-version }}
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ env.VERSION }}-go${{ matrix.go-version }}
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest-go${{ matrix.go-version }}
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ env.VERSION }}-go${{ matrix.go-version }}-ubuntu${{ matrix.ubuntu-version }}
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest-go${{ matrix.go-version }}-ubuntu${{ matrix.ubuntu-version }}
9 changes: 5 additions & 4 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Use Ubuntu 16.04 as the base image
FROM ubuntu:16.04

# Define Go version
# Arguments
ARG UBUNTU_VERSION=16.04
ARG GO_VERSION=1.23.2
ARG ARCH='amd64'
ARG GH_VERSION='2.61.0'

# Use Ubuntu as the base image
FROM ubuntu:${UBUNTU_VERSION}

# Install dependencies
RUN apt-get update && apt-get install -y \
gnupg-agent \
Expand Down

0 comments on commit eee6cab

Please sign in to comment.