RESOLVED: Noob Dockerfile question on ARG BUILD_FROM

General question on home assistant Dockerfiles (and probably Dockerfiles in general)

so, first lines in a ‘production’ Dockerfile is apparently:

ARG BUILD_FROM
FROM $BUILD_FROM

My question: BUILD_FROM what? (call it thingee1, just to make discussion easy)
and the more general correlary: how do I find out what thingee1 is?

and then, where do I put thingee1? in the docker build command line? or right in the Dockerfile first line after BUILD_FROM? or in the ENV? somewhere else?

DISCUSSION:
I’m taking a look at sms_gateway with the code here. It looks like a docker kinda thing. So docker is a new language to me and I can work with it on maybe a ‘see spot run’ level with docker run or docker-compose. Docker build (or buildx?) with Dockerfiles this is a first exposure.

so after an evening of google-fu, I try:

~/sms_gateway $ git clone GitHub - Helios06/sms_gateway: SMS Send/Receive add-on for HomeAssistant
.
~/sms_gateway $ docker build -t “sms_gateway:Dockerfile” .
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
Docker Build Overview | Docker Docs

Sending build context to Docker daemon 1.23MB
Step 1/15 : ARG BUILD_FROM
Step 2/15 : FROM $BUILD_FROM
base name ($BUILD_FROM) should not be blank

Which…a couple of hours with ARG and BUILD_FROM keyword searches resulted in a bunch of nothing.

Now normally I’d post this question on the sms_gateway page, but in the searching I found an addons example Which has the same troublesome lines as the sms_gateway Dockerfile:

ARG BUILD_FROM
FROM $BUILD_FROM

So I decided to post my question here because it may be a general question, not just specific to sms_gateway.

So, my question: BUILD_FROM what?
and the more general corollary: how do I find out what what? is?

Did some more digging, concentrating on the ‘home assistant’ keyword and discovered that more often than not the BUILD_FROM is empty. See for example here and here

Other places not home-assistant there is a ‘FROM’ keyword in the Dockerfile that looks to be an existing base image. as in here or here

While it seems reasonable to think that FROM and BUILD_FROM might be related this is computer stuff so that’s probably a bad assumption to make.

Onward. Or not.

There are some prebuilt os images or service images like Ubuntu, python or Debian

“Build from Debian” is setting Debian as the base of the docker image

There may be more to this but this is basically it

What are you trying to do?

To run HA you don’t need to build dockerfile in this way. You can run the prebuilt file from GitHub.

Specifically, to install sms_gateway on a remote rpi3b for HA to use to send texts to my phone.

HA info:

  • Core 2024.10.2
  • Frontend 20241002.3

OK. tmjpugh set me on the right direction. Actual answer guessed from looking here

~/sms_gateway/sms_gateway $ cat Dockerfile 
ARG BUILD_FROM="alpine"   <-- the equals sign mandatory.  I guessed 'alpine' from the 'apk'  in the RUN statement further down.
FROM $BUILD_FROM

ENV LANG C.UTF-8
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install requirements for add-on
RUN apk add --no-cache python3 py3-pip python3-dev

<clip>

I’m calling this solved. I’m sure there will be more to follow.