Docker Example
This page walks through a minimal, practical Docker setup that:
Runs a
.pmodscenario inside a CPU containerWrites output files into a folder mounted from your host machine
Example folder:
docker/augelab_docker_mount_example_cpu/
What you get
A working
Dockerfilethat runs a headless Python scriptA
docker-compose.ymlthat mounts a host folder into the container at/app/app_outputA 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 folderapp/Dockerfileβ uses an AugeLab Studio CPU base image and runs a Python scriptapp/file_save.pyβ loads the.pmodand runs itapp/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_outputLinux/macOS:
/home/<user>/augelab_output
2) Update docker-compose.yml volume mapping
docker-compose.yml volume mappingOpen 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:
Option A (recommended): environment variable
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?