Skip to content

Set Docker Image to use on Fly

Posted on:September 9, 2022 at 01:35 AM

I’m working on a new Phoenix application that I wanted to deploy to Fly.io. I started with version 1.14 of Elixir which was released a few days ago and when I went to deploy it Fly failed to deply because it couldn’t find the correct Docker image:

Error failed to fetch an image or build from source: error building: failed to solve with frontend dockerfile.v0: 
failed to create LLB definition: docker.io/hexpm/elixir:1.14.0-erlang-25.0.4-debian-bullseye-20210902-slim: not found

I thought it was strange that it’s trying to find an image with a date in the name that pre-dates the release of the version I’m using 🤔. There must be a way to tell Fly what image I want to use as a base, right? There is! Open fly.toml and add an entry for the following:

[build]
  image = "hexpm/elixir:1.14.0-erlang-25.0.4-debian-bullseye-20220801-slim"

This will go get the appropriate image for my use case but any image on Docker hub can be specified here.