• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multi-stage builds for slim container images
#1
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
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  TOSILOCK for CONTAINER COswald 3 2,184 July-13th-2021, 11:32 AM
Last Post: Armin@netPI
  Access to RTC from my own container application tad 1 3,522 March-19th-2021, 02:58 PM
Last Post: Armin@netPI
  [SOLVED] Starting services/commands/scripts at startup of a container Jonas.Sellmann@outlook.de 9 6,040 March-9th-2021, 08:47 AM
Last Post: WalterSchaefer
  OpenVPN container Armin@netPI 0 1,616 January-3rd-2021, 12:13 PM
Last Post: Armin@netPI
  operating Console of a container on netPI connected to Wi-Fi tethering tad 3 2,612 December-3rd-2020, 12:32 PM
Last Post: tad
  NIOT-E-NPIX-4DI4DO with netpi-netx container WalterSchaefer 3 6,481 November-25th-2020, 01:06 PM
Last Post: zen89
  NPIX-4DI4DO and NetPi-Nodered container issues alhammi 4 7,588 November-16th-2020, 01:35 PM
Last Post: alhammi
  Get host MAC via REST API inside container bschandra 4 3,642 November-16th-2020, 09:26 AM
Last Post: bschandra
  Exporting and importing container images Armin@netPI 3 3,067 May-20th-2020, 11:24 AM
Last Post: COswald
Exclamation Creating a container Linnerz 6 4,432 March-6th-2020, 02:47 PM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)