Skip to content

Commit

Permalink
ci: publish odiglet builder from ci when changed and add git (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
blumamir authored Dec 1, 2023
1 parent 0ad6614 commit 6ea2398
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/publish-odiglet-base-builder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Odiglet Base Builder

on:
push:
branches:
- main
paths:
- "odiglet/base.Dockerfile"
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab

# The `workflow_fispatch` event is useful if you want to update the dependencies used
# in the Dockerfile, so they are consumed by future odiglet builds.
# those dependencies are tools like `clang` `llvm` `make` `libbpf-devel` `git`

permissions:
contents: write
packages: write

env:
DOCKERHUB_ORG: "keyval"

jobs:
publish-odiglet-base-builder:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Publish Odiglet Base Builder
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./odiglet/base.Dockerfile
push: true
tags: ${{ env.DOCKERHUB_ORG }}/odiglet-base:latest
26 changes: 26 additions & 0 deletions .github/workflows/verify-odiglet-base-builder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Verify Odiglet Base Builder

# This workflow is designed to verify the Odiglet Base Builder Dockerfile on pull requests.
# It builds the Dockerfile without pushing it, ensuring that it's valid and can successfully create an image.

on:
pull_request:
paths:
- "odiglet/base.Dockerfile"

jobs:
verify-odiglet-base-builder:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Verify Odiglet Base Builder
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
file: ./odiglet/base.Dockerfile
push: false
3 changes: 2 additions & 1 deletion odiglet/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM fedora:38 as builder
ARG TARGETARCH
RUN dnf install clang llvm make libbpf-devel -y
# git is used by go mod download
RUN dnf install clang llvm make libbpf-devel git -y
RUN curl -LO https://go.dev/dl/go1.21.0.linux-${TARGETARCH}.tar.gz && tar -C /usr/local -xzf go*.linux-${TARGETARCH}.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

0 comments on commit 6ea2398

Please sign in to comment.