-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: publish odiglet builder from ci when changed and add git (#795)
- Loading branch information
Showing
3 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" |