Private docker image or cross-app pull

I have a multi-tenant setup where each of my clients has their own Fly.io app but uses the same codebase image. Right now when creating a new app i would have to create the app and then upload the image to the app name fly.io repository.

The app’s can be temporary at times and i want to decrease the deployment time. Preventing to have to push the image to every app individually. I can do this by making the docker image public, but i prefer not to. Can i use a docker image on the fly.io repository from one app on my own account for newly to be created apps? Or is there some kind of global/cross-app fly.io registry?

You can pull images from other apps in your account. I have a separate containers app and use that in my other apps. Here’s script I use to build/push images locally (on M1 mac, so has some extra stuff to build for amd64). You’ll need to run flyctl auth docker if you haven’t.

VERSION=1.1
IMAGE=registry.fly.io/<YOUR-NAME>-containers:my-app$VERSION
BUILDER=image_builder
echo "Building $IMAGE"
docker buildx use $BUILDER || docker buildx create --use --name $BUILDER
DOCKER_BUILD_KIT=1 DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build --platform linux/amd64 --push -t $IMAGE .
docker buildx stop

Then in your Dockerfile:

FROM registry.fly.io/<YOUR-NAME>-containers:my-app1.1

Similar thread here

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.