Skip to content

fix dockerfile symlink issues #2

fix dockerfile symlink issues

fix dockerfile symlink issues #2

Workflow file for this run

name: Build and Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build and Test Containers
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Create empty certificate file for build
run: |
mkdir -p certs/org
touch certs/org/mitre-ca-bundle.pem
# Modified to ensure Dockerfiles exist instead of relying on symlinks
- name: Prepare Dockerfiles
run: |
# Instead of relying on symlinks, directly reference the actual files
echo "Using Dockerfile for full build"
echo "Using Dockerfile.optimized for minimal build"
- name: Build minimal container
uses: docker/build-push-action@v4
with:
context: .
# Directly use the actual Dockerfile.optimized instead of a symlink
file: ./Dockerfile.optimized
push: false
tags: cac-builder:minimal-test
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
- name: Test minimal container
run: |
docker run --rm cac-builder:minimal-test -c "mkdir -p /content/build && cd /content/build && cmake .. && echo 'Build environment test: SUCCESS'"
- name: Build full container
uses: docker/build-push-action@v4
with:
context: .
# Directly use the actual Dockerfile instead of a symlink
file: ./Dockerfile
push: false
tags: cac-builder:full-test
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILD_TYPE=full
load: true
- name: Test full container
run: |
mkdir -p output
docker run -v ${{ github.workspace }}/output:/output --rm cac-builder:full-test -c "ls /content/build/ssg-* && cp /content/build/ssg-rhel* /output/ 2>/dev/null || echo 'No content found, checking build environment'"
- name: Verify output files (full build only)
run: |
ls -la output/ || echo "No output files found - this is expected in PR builds"