OCI Image Builder & Publisher Pipeline for WinCC OA Analyzer
🎯 Goal
Create a GitHub Actions pipeline that:
- Pulls the latest base image from
mpokornyetm/winccoa:general
- Detects whether a new base image version exists
- Builds a new OCI compliant image on top of the base image
- Registers a WinCC OA project inside the container using shell commands
- Starts a CTRL Manager inside the container to validate the image
- Pushes the final image to:
- GitHub Container Registry (GHCR)
- Docker Hub
- Runs weekly on a schedule
- Runs inside an organization repository
🧱 Base Image
https://hub.docker.com/repository/docker/mpokornyetm/winccoa/general
🏗️ Pipeline Overview
- Trigger
- Weekly cron schedule
- Manual dispatch
- Optional: trigger when base image changes (digest check)
- Steps
- Checkout repository
- Pull base image
- Compare digest with last known digest
- If unchanged → exit
- Build new OCI image using Docker Buildx
- Run WinCC OA project registration script inside container
- Start CTRL Manager inside container
- Validate that the manager starts successfully
- Tag image for GHCR + Docker Hub
- Push to both registries
- Update stored digest
- Notify success/failure
🧪 Validation Logic
Inside the container:
- Run WinCC OA project registration:
/opt/WinCC_OA/<version>/bin/WCCOApmon -autofreg -status -config <absolutePathToProjectConfigFile>
- Start CTRL Manager:
/opt/WinCC_OA/<version>/bin/WCCOActrl <ctrlScriptFile.ctl> -proj myproj
- Check exit code
- Check logs for startup success
- If failure → pipeline stops, no push
🐳 Dockerfile Template (OCI ready)
`Dockerfile
FROM mpokornyetm/winccoa:general
Copy analyzer tools
COPY analyzer /usr/local/bin/analyzer
Register project at build time (optional)
RUN /opt/WinCC_OA//bin/WCCOApmon -regSub -config <...>
ENTRYPOINT ["/usr/local/bin/analyzer"]
`
🚀 GitHub Actions Workflow (High Level Plan)
Workflow name
oci-image-builder.yml
Jobs
job: check-base-image
- Pull base image
- Extract digest
- Compare with stored digest file in repo
- If unchanged → stop workflow
job: build-oci-image
- Set up Docker Buildx
- Build OCI image:
docker buildx build --output type=oci,dest=analyzer.oci .
- Also build normal Docker image for validation:
docker build -t analyzer:test .
job: validate-image
- Run container:
docker run --rm analyzer:test /opt/WinCC_OA/.../WCCOAregProject -create testproj
- Start CTRL Manager:
docker run --rm analyzer:test /opt/WinCC_OA/.../WCCOActrl -proj testproj -num 1
- Check logs for success
- If failure → fail job
job: push-images
- Login to GHCR
- Login to Docker Hub
- Tag image:
docker tag analyzer:test ghcr.io/<org>/winccoa-analyzer:latest docker tag analyzer:test <dockerhub-user>/winccoa-analyzer:latest
- Push both:
docker push ghcr.io/<org>/winccoa-analyzer:latest docker push <dockerhub-user>/winccoa-analyzer:latest
job: update-digest
- Write new digest to base-image-digest.txt
- Commit & push to repo
🕒 Schedule
`
schedule:
- cron: "0 3 1" # Every Monday at 03:00
`
🔐 Secrets Required
- GHCR_TOKEN
- DOCKERHUB_USERNAME
- DOCKERHUB_TOKEN
- Optional: WINCCOA_LICENSE (if needed)
📦 Output
- OCI image: analyzer.oci
- GHCR image: ghcr.io//winccoa-analyzer:latest
- Docker Hub image: /winccoa-analyzer:latest
- Updated digest file
📝 Notes
- The pipeline must run in an organization repository.
- The pipeline must fail early if:
- base image unchanged
- build fails
- project registration fails
- CTRL Manager fails to start
- Only push when validation succeeds.
OCI Image Builder & Publisher Pipeline for WinCC OA Analyzer
🎯 Goal
Create a GitHub Actions pipeline that:
mpokornyetm/winccoa:general
🧱 Base Image
https://hub.docker.com/repository/docker/mpokornyetm/winccoa/general🏗️ Pipeline Overview
🧪 Validation Logic
Inside the container:
/opt/WinCC_OA/<version>/bin/WCCOApmon -autofreg -status -config <absolutePathToProjectConfigFile>/opt/WinCC_OA/<version>/bin/WCCOActrl <ctrlScriptFile.ctl> -proj myproj🐳 Dockerfile Template (OCI ready)
`Dockerfile
FROM mpokornyetm/winccoa:general
Copy analyzer tools
COPY analyzer /usr/local/bin/analyzer
Register project at build time (optional)
RUN /opt/WinCC_OA//bin/WCCOApmon -regSub -config <...>
ENTRYPOINT ["/usr/local/bin/analyzer"]
`
🚀 GitHub Actions Workflow (High Level Plan)
Workflow name
oci-image-builder.ymlJobs
job: check-base-image
job: build-oci-image
docker buildx build --output type=oci,dest=analyzer.oci .docker build -t analyzer:test .job: validate-image
docker run --rm analyzer:test /opt/WinCC_OA/.../WCCOAregProject -create testprojdocker run --rm analyzer:test /opt/WinCC_OA/.../WCCOActrl -proj testproj -num 1job: push-images
docker tag analyzer:test ghcr.io/<org>/winccoa-analyzer:latest docker tag analyzer:test <dockerhub-user>/winccoa-analyzer:latestdocker push ghcr.io/<org>/winccoa-analyzer:latest docker push <dockerhub-user>/winccoa-analyzer:latestjob: update-digest
🕒 Schedule
`
schedule:
`
🔐 Secrets Required
📦 Output
📝 Notes