February-7th-2019, 04:14 PM
These days it was time to think about Docker's multi-stage build feature and to provide an example of how it works.
Multi-stage builds are always then of any interest if applications need to be compiled first before getting them to an executeable state and as such be installed in the final container image ... but without all the necessary development tools, environments and compilers. This keeps the image small and away from all unnecessary data needed during compilation times only.
We found that the bluetooth registry on DockerHub would be best for a demonstration. Its Dockerfile contains two FROM commands the build process turns into two separate builds. Build STEP 1 creates a temporary container and compiles the bluetooth stack ... Build STEP 2 builds the final output container that is just copying the required outputs files of STEP 1.
Happy testing
Armin
Multi-stage builds are always then of any interest if applications need to be compiled first before getting them to an executeable state and as such be installed in the final container image ... but without all the necessary development tools, environments and compilers. This keeps the image small and away from all unnecessary data needed during compilation times only.
We found that the bluetooth registry on DockerHub would be best for a demonstration. Its Dockerfile contains two FROM commands the build process turns into two separate builds. Build STEP 1 creates a temporary container and compiles the bluetooth stack ... Build STEP 2 builds the final output container that is just copying the required outputs files of STEP 1.
Happy testing
Armin
„You never fail until you stop trying.“, Albert Einstein (1879 - 1955)