feat: consolidate Dockerfiles with build arguments (Issue #115 Task #4) #127
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Consolidates duplicate Dockerfiles into a single unified version using Docker build arguments.
Addresses: #115 - Task #4 (Fresh Installation Testing)
Problem Solved
Previously maintained two separate, nearly identical Dockerfiles:
Docker/Dockerfile- Standalone IVIM fittingkaapana_ivim_osipi/.../Dockerfile- Kaapana deploymentThis created maintenance overhead and code duplication.
Solution
Created
Docker/Dockerfile.unifiedwith build arguments:BASE_IMAGE(default:python:3.11-slim) - Specify base Docker imageENV_TYPE(default:standalone) - Choose environment typeBuilding
Standalone (default)
docker build --build-arg ENV_TYPE=standalone
-t ivim-fitting:standalone
-f Docker/Dockerfile.unified .
Kaapana Deployment
docker build --build-arg BASE_IMAGE=local-only/base-python-cpu:latest
--build-arg ENV_TYPE=kaapana
-t ivim-fitting:kaapana
-f Docker/Dockerfile.unified .
Testing Completed
Local Testing (Docker Desktop - Windows)
Standalone build succeeds
Image ID:
75a626d42f0bSize: 13.2GB
Entry point:
python3 -m WrapImage.nifti_wrapperKaapana build succeeds (with python:3.11-slim base)
Image ID:
f662fb55bfeeSize: 14GB
Entry point:
python3 -u -m WrapImage.nifti_wrapper_kaapanaBoth conditional logic statements work correctly
File copying and dependencies install without errors
Build scripts execute correctly
Integration Testing (Requires Kaapana Platform)
local-only/base-python-cpu:latestbase imageOPERATOR_IN_DIR,OPERATOR_OUT_DIR)Files Added
Docker/Dockerfile.unified- Unified DockerfileDocker/build-standalone.sh- Standalone build scriptDocker/build-kaapana.sh- Kaapana build scriptDocker/DOCKERFILE_MERGE.md- Detailed documentationRelated
Note: Testing limited to local Docker Desktop due to hardware constraints. Both image variants build successfully and are ready for integration testing in a Kaapana deployment environment.