diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..969b403 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,44 @@ +--- +name: Docker Build Action +on: + pull_request: + branches: + - main + push: + branches: + - main + tags: + - '*' + +env: + EDK2_TAG: edk2-stable202408.01 + REGISTRY: ghcr.io + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/metal-stack/mini-lab-ovmf + + - name: Log in to the container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.DOCKER_REGISTRY_USER }} + password: ${{ secrets.DOCKER_REGISTRY_TOKEN }} + + - name: Build and push mini-lab-ovmf image + uses: docker/build-push-action@v6 + with: + build-args: ${{ env.EDK2_TAG }} + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57f1cb2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.idea/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..20a1786 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# See https://fabianlee.org/2018/09/12/kvm-building-the-latest-ovmf-firmware-for-virtual-machines/ +FROM docker.io/debian:bookworm-backports AS build + +RUN apt-get update && \ + apt-get install --yes \ + build-essential \ + git \ + uuid-dev \ + iasl \ + nasm \ + python3-dev \ + python-is-python3 + +ARG EDK2_TAG=edk2-stable202408.01 + +RUN git clone --depth 1 "https://github.com/tianocore/edk2.git" -b ${EDK2_TAG} --recurse-submodules --shallow-submodules + +WORKDIR /edk2 + +SHELL ["/bin/bash", "-c"] + +RUN source ./edksetup.sh && \ + make -C BaseTools/ && \ + build -a X64 -t GCC5 -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc \ + -DBUILD_SHELL=FALSE \ + -DNETWORK_IP4_ENABLE=TRUE \ + -DNETWORK_IP6_ENABLE=FALSE \ + -DNETWORK_HTTP_BOOT_ENABLE=FALSE \ + -DNETWORK_VLAN_ENABLE=FALSE + +FROM scratch + +COPY --from=build /edk2/Build/OvmfX64/RELEASE_GCC5/FV/OVMF_*.fd /