Hello everyone, I made some improvements to Dockerfile and docker-compose, I hope it will be helpful in the community.
What was improved?
Reduction in final image size from 10.3GB to 7.19GB
Update nvidia/cuda image from 11.3.1-base-ubuntu20.04 to 11.8.0-base-ubuntu22.04
Customization of the execution of files from the optimizedSD directory
Update numpy from 1.19.2 to 1.20.3
How to use execution customization?
If you need to run another file from the OptimizedSD directory, is possible to modify the default execution, by changing the environment variable APP_MAIN_FILE in docker-compose.yml and doing a new build by running:
docker-compose up --build
If you don't want to use docker-compose, you can provide the OPTIMIZED_FILE argument with the following command.
Wrong: to ensure that the tests do not have side effects, please remove container and docker images related to the project.
Ideas to improve build time in the future
The venv could be uploaded to some storage and when building the image download the environment, this will probably be considerably faster than the build step.
Positive: The image does not need to go through several steps to build the environment (compression and decompression, downloading packages)
Negative: I would need to update venv whenever new dependencies are added to the project
Docker image customization and minification
Hello everyone, I made some improvements to Dockerfile and docker-compose, I hope it will be helpful in the community.
What was improved?
10.3GB
to7.19GB
nvidia/cuda
image from11.3.1-base-ubuntu20.04
to11.8.0-base-ubuntu22.04
optimizedSD
directory1.19.2
to1.20.3
How to use execution customization?
OptimizedSD
directory, is possible to modify the default execution, by changing the environment variableAPP_MAIN_FILE
indocker-compose.yml
and doing a new build by running:OPTIMIZED_FILE
argument with the following command.What was not improved?
Wrong: to ensure that the tests do not have side effects, please remove container and docker images related to the project.
Ideas to improve build time in the future
The
venv
could be uploaded to some storage and when building the image download the environment, this will probably be considerably faster than the build step.Positive: The image does not need to go through several steps to build the environment (compression and decompression, downloading packages)
Negative: I would need to update
venv
whenever new dependencies are added to the project