Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go 1.21, default.pgo, alpine + ubuntu-22.04/20.04 images #469

Merged
merged 16 commits into from
Aug 14, 2023
Prev Previous commit
Next Next commit
Build images with matrix
  • Loading branch information
vadimalekseev committed Aug 13, 2023
commit 8f315d929a844009cc4ffc1ce957ac5769bd7f35
20 changes: 16 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ jobs:
permissions:
packages: write
contents: read

strategy:
fail-fast: false
matrix:
image:
- name: 'ubuntu:18.04'
suffix: '-ubuntu18.04'
- name: 'ubuntu:20.04'
suffix: '-ubuntu20.04'
- name: 'ubuntu:22.04'
suffix: '-ubuntu22.04'
- name: 'ubuntu:latest'
suffix: ''
steps:
- uses: actions/checkout@v3

Expand All @@ -35,6 +46,7 @@ jobs:
uses: docker/build-push-action@v4
with:
push: true
build-args:
- VERSION=${{ steps.set-version.outputs.VERSION }}
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ steps.set-version.outputs.VERSION }}
build-args: |
VERSION=${{ steps.set-version.outputs.VERSION }}
APP_IMAGE=${{ matrix.app_image }}
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ steps.set-version.outputs.VERSION }}${{ matrix.image.suffix }}
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
ARG APP_IMAGE=ubuntu:latest

# Build
FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS build

ARG VERSION
ARG BUILD_TIME

RUN apk update
RUN apk add git

WORKDIR /file.d

COPY go.mod go.sum ./
Expand All @@ -25,7 +24,7 @@ RUN go build -trimpath \
-o file.d ./cmd/file.d

# Deploy
FROM ubuntu:20.04
FROM $APP_IMAGE

RUN apt update
RUN apt install systemd strace tcpdump traceroute telnet iotop curl jq iputils-ping htop -y
Expand Down