Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

STRATfinder Docker Image

This repository builds Docker images for STRATfinder

Usage of the image

This closely follows the original structure of the STRATfinder code.

directly via docker

docker run --rm -ti \
    --user $(id -u):$(id -g) \
    --volume $PWD:/data stratfinder:latest \
    /data/<path to json config file> \
    /data/< path to overlap file otherwise use: ""> \
    /data/< path to today file > \
    /data/< path to output file > \
    /data/< path to beta output file > \
    /data/< path to yesterday file otherwise use: ""> \
    < path to the stratfinder directory otherwise use: ""> \
  • --user $(id -u):$(id -g) use the system's user in the container to get file permissions right
  • -v $PWD:/data stratfinder:latest \ mounts the current working directory to /data inside the container
  • /data/settings_STRATfinder_cl61_urbi_Paris.json is the path to the stratfinder config file

an example for a single file could be:

  • the /data prefix is due to the mount of the current working directory
  • we read a file from the daily directory
  • we write the output files to a output directory
# !/bin/bash

set -eux pipefail

docker run --rm -ti \
    --user $(id -u):$(id -g) \
    --volume $PWD:/data stratfinder:latest \
    /data/stratfinder_settings_cl61.json \
    "" \
    /data/daily/20260316.nc \
    /data/output/20260316_stratfinder.nc \
    /data/output/20260315_beta.nc \
    "" \
    ""

via python

A small python script (stratfinder.py) wraps the docker command, however hides all user permission, mounting, and path complexities. Note that all paths must be relative to the current working directory since this is mounted. Moving up (../) does not work. with this setup

Prerequisites

  • Docker installed and running
  • GNU Make
  • Git
  • The stratfinder/ submodule checked out

If the submodule is not initialized yet:

git submodule update --init

Quick Start

Build with defaults:

make build

Default values:

  • STRATFINDER_REF=master
  • MATLAB_VERSION=r2025b
  • IMAGE_NAME=stratfinder

The build creates two tags:

  • <IMAGE_NAME>:<STRATFINDER_VERSION>-<MATLAB_VERSION>
  • <IMAGE_NAME>:latest

Example (typical):

  • stratfinder:<master-version>-r2025b
  • stratfinder:latest

Before the Docker build starts, make build automatically applies patch files from patches/ in strict order:

  • 0.patch, 1.patch, 2.patch, ..., n.patch

Build fails if numbering is not consecutive from 0.

If a patch is already applied, it is detected and skipped.

After the build finishes (or fails), the stratfinder/ submodule is automatically restored to the master branch.

Build With Custom Versions

Build a specific STRATfinder tag:

make build STRATFINDER_REF=v2025.10

Build a specific STRATfinder commit:

make build STRATFINDER_REF=e0c6239

Build with another MATLAB Runtime version:

Note that you will first have to compile the binary and place it in bin. Currently only one binary is present - with the patch applied.

make build MATLAB_VERSION=r2024b

Build with a custom image name:

make build IMAGE_NAME=my-stratfinder

You can combine overrides:

make build STRATFINDER_REF=v2025.10 MATLAB_VERSION=r2024b IMAGE_NAME=my-stratfinder

Use a custom patch directory:

make build PATCH_DIR=patches

Show Available Targets

make help

Verify Built Images

List images:

docker images | grep stratfinder

If you used a custom image name:

docker images | grep my-stratfinder

Clean Images

Remove built image tags managed by this Makefile:

make clean

Notes:

  • make clean always tries to remove <IMAGE_NAME>:latest when it exists.
  • Tagged image removal (<IMAGE_NAME>:<tag>) depends on IMAGE_TAG being set in the environment or make invocation.
  • If an image does not exist, cleanup prints a skip message and continues.

Publishing to GitHub Container Registry

Images are published to ghcr.io via the Build and Push Docker Image workflow, which is triggered manually.

Via the GitHub UI: Actions → Build and Push Docker Image → Run workflow. Fill in stratfinder_ref (default: master) and matlab_version (default: r2025b).

The published image will be tagged as:

  • ghcr.io/<owner>/<repo>:<stratfinder-version>-<matlab-version> (e.g. v2025.10-r2025b)
  • ghcr.io/<owner>/<repo>:latest

A signed build-provenance attestation is generated and pushed alongside each image.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages