I have two images inside an app. They are like so, with one inheriting from the other:
sequoia-browser-small
, parent =FROM node:22-bookworm-slim
sequoia-browser-large
, parent =FROM sequoia-browser-small
These build fine in Docker locally.
I have a little creation script for Fly:
#!/bin/bash
createMachine () {
NAME=$1
DOCKER_PATH=$2
MEMORY=$3
flyctl machine create \
. \
--config machines/fly.toml \
--region lhr \
--org Personal \
--vm-memory $MEMORY \
--dockerfile $DOCKER_PATH \
--name $NAME
}
createMachine "sequoia-browser-small" "machines/small/Dockerfile" "256M"
createMachine "sequoia-browser-large" "machines/large/Dockerfile" "1024M"
However the second one does not work, because the local image FROM name sequoia-browser-small
is not specific enough. I could change it in the Dockerfile to registry.fly.io/sequoia-browser-test:deployment-xxx
but then local builds would fail.
I guess I could rename my local build output to match the remote. However, I would need Fly not to dynamically name the image; is there a machine create
switch for that?
For now, I have found --build-local-only
, which seems to work. It’s a bit slower due to needing to send the image over a slow internet connection, but that’s not a major bother. As an aside, I found that switch documented on the web, and it seems it is not detailed in flyctl machine create --help
. Is this an oversight, or is the switch deprecated?