Docker Example

This page walks through a minimal, practical Docker setup that:

  1. Runs a .pmod scenario inside a CPU container

  2. Writes output files into a folder mounted from your host machine

Example folder:

docker/augelab_docker_mount_example_cpu/


What you get

  • A working Dockerfile that runs a headless Python script

  • A docker-compose.yml that mounts a host folder into the container at /app/app_output

  • A ready-to-run example .pmod (save_image_no_args.pmod)


Files in the example folder

Inside docker/augelab_docker_mount_example_cpu/:

  • docker-compose.yml β€” builds the image and mounts a host folder

  • app/Dockerfile β€” uses an AugeLab Studio CPU base image and runs a Python script

  • app/file_save.py β€” loads the .pmod and runs it

  • app/save_image_no_args.pmod β€” a sample scenario


Step-by-step

1) Choose an output folder on your host

Pick (or create) a folder on your host machine where the container is allowed to write files.

Examples:

  • Windows: C:/work/augelab_output

  • Linux/macOS: /home/<user>/augelab_output


2) Update docker-compose.yml volume mapping

Open docker/augelab_docker_mount_example_cpu/docker-compose.yml and change the volume line:

Alternatively, you can use a relative folder (recommended for portable projects):

On Windows, Docker expects paths like C:/... (forward slashes). Avoid backslashes. { % endhint %}


3) Provide licensing (verification code or license file)

Your script must pass a verification_code when creating StudioScenario.

Recommended options:

Export an environment variable and read it in your Python code.

Add to docker-compose.yml:

Then in the script, use:

Option B: mount a license file and pass its path

Mount your license file into the container and pass the container path as verification_code.

Example snippet:


4) Build and run

From the folder that contains docker-compose.yml:

You should see logs and the scenario execution result in the container output.


5) Verify the host output folder

Check your host folder (the one you mounted into /app/app_output).

If your .pmod writes files (images, reports, etc.) to that output path, you should see them appear on the host immediately.

If you do not see files on the host, double-check that your `.pmod` is configured to write into `/app/app_output` (or adjust the mount point to match your scenario). { % endhint %}

Last updated

Was this helpful?