-
Notifications
You must be signed in to change notification settings - Fork 43
feat: consolidate Dockerfiles with build arguments (Issue #115 Task #4) #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ask OSIPI#4) - Create unified Dockerfile.unified supporting both standalone and Kaapana - Add build-standalone.sh and build-kaapana.sh convenience scripts - Document consolidation approach and testing performed - Uses ARG for BASE_IMAGE and ENV_TYPE configuration Testing completed: - Standalone build: Successfully created (13.2GB) Image ID: 75a626d42f0b - Kaapana build: Successfully created (14GB) Image ID: f662fb55bfee - Both images build without errors - Conditional logic (if statements) work correctly - Entry points properly configured for each environment Integration testing requires: - Actual Kaapana base image (local-only/base-python-cpu:latest) - Kaapana platform deployment - Workflow execution in Kaapana UI
|
@etpeterson, while I take a look at this, whenever you are chanced, you can also take a look. |
|
I like this direction. This could also remove the old docker files. |
|
I also see failing docker tests. |
|
I looked a little more and it looks like the docker build might not entirely be your problem, but we should get it working to confirm your changes are correct. |
- Refactored Dockerfile.unified to use multi-stage builds - Eliminated conditional if statements for cleaner code flow - Separated base, standalone, and kaapana stages - Updated build scripts to use --target flag Testing: - Standalone build succeeds (13.2GB, ID: 7b877408f593) - Kaapana build succeeds (14GB, ID: 8d8c72fbd004) - Both images build without errors - Multi-stage approach eliminates conditionals - Build flow is now easier to follow
|
Hi @etpeterson, I've refactored the Dockerfile to use multi-stage builds as you suggested. Changes Made
New Build CommandsStandalone Kaapana Testing ResultsBoth builds tested successfully on Windows Docker Desktop:
QuestionsRegarding the failing Docker test:
Regarding old Dockerfiles: Let me know if you need any other changes! Thanks, |
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.