Hi, this is a question that partially comes from my nativity of how Docker works, so I’m looking for clarification on my particular scenario.
For our devices, we will be doing all initial provisioning and imaging ourselves. However–once customers receive the device, it is reasonable to assume they will be in an airgapped environment with no internet access for much of their lives.
My question is–how does this work from a Docker perspective? If I have a RUN apt-get install python3 line in my dockerfile, will that execute once when the image is pushed and then “live” on the device, or will that line just fail on every boot in a non-internet connected environment and stop the image from working?
Thank you
Hello @madlyfins and welcome to the balena forums.
The use case of air gapped devices is quite common through the balena devices. So in short, what you are going to do is the proper way. I’m giving some details now.
The build, deploy and runtime on balenaCloud is basically a four step process:
- Build: build the image locally or use balena cloud builders
- Store: store the build image on the balena image registries
- Pull: pull the image from the balena image registries to the device
- Execute: execute balena image on the device and create a running container from it.
By specifying a dockerfile
you describe how the docker image should be constructed and what the image should executed by default when loaded by a docker image compatible execution runtime, such as balena engine or docker engine.
- The line
RUN apt-get install python3
will executed during the build step of the image. Afterwards a layer containing the result of RUN apt-get install python3
is added to the image.
- The whole image is stored on the balena registries and devices can now pull this image from there
- The device has to pull the image at least once to have the image on the device local storage
- At runtime python3 installation is available in the container that was created from the image
Let us know if you need further information or details.
Harald
Understood! This was very helpful, thank you.