The container has two main python applications and bash wrappers for them to demonstrate how containers access to host file system.
This is the default application
This will print some details about the container and the home directory as it see it
If one or more files (absolute paths) are provided as arguments, the script will check if they are accessible from the container
If accessible, look for numbers, line by line. Numbers found are summed and the total is printed as output.
example
$: docker run --name sum-file sabryr/nris-training-sum-from-file file-with-numbers.txt
Operating System is Linux #17~24.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 20 22:48:29 UTC 2 release:6.11.0-17-generic
Python Version is 3.13.2 (main, Feb 25 2025, 05:25:21) [GCC 12.2.0]
Home directory is /user1
Current working directory /user1
Files to check (provided as arguments):
1) '/data/number-list.txt' found /data.
# Sum of numbers found=288.0 | skipped lines=0
This application prints the mounts points as the container see them
$: docker exec <container_id_or_name> file-with-numbers.txt
$: docker run --name sum-file sabryr/nris-training-sum-from-file file-with-numbers.txt --output out-file.txt
Content type
Image
Digest
sha256:80a8940e4…
Size
364.1 MB
Last updated
over 1 year ago
docker pull sabryr/nris-training-sum-from-file