1
0
Fork 0
mirror of https://github.com/JasonN3/build-container-installer.git synced 2025-12-25 10:57:55 +01:00

manually run docker

This commit is contained in:
Jason N. 2024-02-26 09:13:59 -05:00
parent 8b04f82012
commit 218bb28db1
5 changed files with 57 additions and 13 deletions

View file

@ -17,8 +17,48 @@ env:
VARIANT: 'Server'
jobs:
build-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
jasonn3/build-container-installer
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Buildah Build
id: build-image
uses: redhat-actions/buildah-build@v2
with:
containerfiles: Containerfile
tags: ${{ steps.meta.outputs.tags }}
- name: Push image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/jasonn3
username: ${{ github.actor }}
password: ${{ github.token }}
build-and-push-iso:
runs-on: ubuntu-latest
needs:
- build-container
permissions:
contents: read
packages: write

View file

@ -56,8 +56,8 @@ boot.iso: lorax_templates/set_installer.tmpl lorax_templates/configure_upgrades.
mv $(_BASE_DIR)/results/images/boot.iso $(_BASE_DIR)/
# Step 3: Download container image
container/$(IMAGE_NAME)-$(IMAGE_TAG):
mkdir container || true
build/container/$(IMAGE_NAME)-$(IMAGE_TAG):
mkdir build/container || true
podman pull $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
podman save --format oci-dir -o $(_BASE_DIR)/container/$(IMAGE_NAME)-$(IMAGE_TAG) $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)
podman rmi $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG)

View file

@ -31,13 +31,17 @@ inputs:
default: "false"
runs:
using: docker
image: 'Dockerfile'
args:
- ARCH=${{ inputs.arch }}
- IMAGE_NAME=${{ inputs.image_name }}
- IMAGE_REPO=${{ inputs.image_repo }}
- VARIANT=${{ inputs.variant }}
- VERSION=${{ inputs.version }}
- IMAGE_TAG=${{ inputs.image_tag || inputs.version }}
- WEB_UI=${{ inputs.web_ui }}
using: composite
steps:
- name: Run docker image
shell: bash
run: |
tag=$( echo ${{ github.ref_name }} | tr '/' ' ' | awk '{ print $1 }' )
docker run --privileged --volume .:/github/workspace/ ghcr.io/jasonn3/build-container-image:${tag} \
ARCH=${{ inputs.arch }} \
IMAGE_NAME=${{ inputs.image_name }} \
IMAGE_REPO=${{ inputs.image_repo }} \
VARIANT=${{ inputs.variant }} \
VERSION=${{ inputs.version }} \
IMAGE_TAG=${{ inputs.image_tag || inputs.version }} \
WEB_UI=${{ inputs.web_ui }}

View file

@ -2,7 +2,7 @@
set -ex
make container/${IMAGE_NAME}-${IMAGE_TAG} $@
make build/container/${IMAGE_NAME}-${IMAGE_TAG} $@
make boot.iso $@