Docker Error - Failed to fetch an image or build from source

==> Verifying app config
→ Verified app config
==> Building image
Remote builder fly-builder-dark-snowflake-3297 ready
==> Creating build context
→ Creating build context done
==> Building image with Docker
→ docker host: 20.10.12 linux x86_64
[+] Building 0.2s (0/1)
[+] Building 0.5s (4/4) FINISHED
=> CACHED [internal] load remote build context 0.0s
=> CACHED copy /context / 0.0s
=> [internal] load metadata for Docker Hub 0.3s
=> ERROR [internal] load metadata for 0.5s

[internal] load metadata for

Error failed to fetch an image or build from source: error building: failed to solve with frontend dockerfile.v0: failed to create LLB definition: not found

Someone would have an insight to help me understand this error?

This looks like it could be due to connection issues with our remote Docker builder.

Can you try running the fly doctor command and pasting what you see ?

Thank you Rahmatjunaid,
Here is the output:

s@W530:~/Documents/Deploy/nemesis-master$ fly doctor
Testing authentication token... PASSED
Testing flyctl agent... PASSED
Testing local Docker instance... Nope
Pinging WireGuard gateway (give us a sec)... PASSED

I tested my local docker installation with the hello-world test:

s@W530:~/Documents/Deploy/nemesis-master$ sudo docker run hello-world
[sudo] password for s: 
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:53f1bbee2f52c39e41682ee1d388285290c5c8a76cc92b42687eecf38e0af3f0
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

Hum…when I try to build the image with Docker locally with the Dockerfile generated by fly launch, I get this output:

Sending build context to Docker daemon  7.768MB
Step 1/33 : ARG BUILDER_IMAGE="hexpm/elixir:1.13.4-erlang-25.0.3-debian-bullseye-20210902-slim"
Step 2/33 : ARG RUNNER_IMAGE="debian:bullseye-20210902-slim"
Step 3/33 : FROM ${BUILDER_IMAGE} as builder
manifest for hexpm/elixir:1.13.4-erlang-25.0.3-debian-bullseye-20210902-slim not found: manifest unknown: manifest unknown

Is it possible to see the full dockerfile in a gist or repo?

Thank you Heyjordn.
I haven’t touched the file generated by the fly launch command:

# Find eligible builder and runner images on Docker Hub. We use Ubuntu/Debian instead of
# Alpine to avoid DNS resolution issues in production.
# This file is based on these images:
#   - - for the build image
#   - - for the release image
#   - - resource for finding needed packages
#   - Ex: hexpm/elixir:1.13.4-erlang-25.0.3-debian-bullseye-20210902-slim
ARG BUILDER_IMAGE="hexpm/elixir:1.13.4-erlang-25.0.3-debian-bullseye-20210902-slim"
ARG RUNNER_IMAGE="debian:bullseye-20210902-slim"

FROM ${BUILDER_IMAGE} as builder

# install build dependencies
RUN apt-get update -y && apt-get install -y build-essential git \
    && apt-get clean && rm -f /var/lib/apt/lists/*_*

# prepare build dir

# install hex + rebar
RUN mix local.hex --force && \
    mix local.rebar --force

# set build ENV
ENV MIX_ENV="prod"

# install mix dependencies
COPY mix.exs mix.lock ./
RUN mix deps.get --only $MIX_ENV
RUN mkdir config

# copy compile-time config files before we compile dependencies
# to ensure any relevant config change will trigger the dependencies
# to be re-compiled.
COPY config/config.exs config/${MIX_ENV}.exs config/
RUN mix deps.compile

COPY priv priv

# note: if your project uses a tool like,
# which customizes asset compilation based on what it finds in
# your Elixir templates, you will need to move the asset compilation
# step down so that `lib` is available.
COPY assets assets

# compile assets
RUN mix assets.deploy

# Compile the release
COPY lib lib

RUN mix compile

# Changes to config/runtime.exs don't require recompiling the code
COPY config/runtime.exs config/

COPY rel rel
RUN mix release

# start a new build stage so that the final image will only contain
# the compiled release and other runtime necessities

RUN apt-get update -y && apt-get install -y libstdc++6 openssl libncurses5 locales \
  && apt-get clean && rm -f /var/lib/apt/lists/*_*

# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen


WORKDIR "/app"
RUN chown nobody /app

# Only copy the final release from the build stage
COPY --from=builder --chown=nobody:root /app/_build/prod/rel/nemesis ./

USER nobody

CMD ["/app/bin/server"]

# Appended by flyctl
ENV ERL_AFLAGS "-proto_dist inet6_tcp"

Looks like it might be the remote builder fly-builder-dark-snowflake-3297 like @rahmatjunaid had said, not sure if @michael or @jsierles could check the runner’s region to dig deeper

Might be similar to this one

It looks like this image disappeared :frowning:

Can you try updating your Dockerfile with:


Also which version of Phoenix are you using? This built-in command may give you a good Dockerfile

mix phx.gen.release --docker

Thanks Jsierles,

I am on Phoenix 1.6.6; I modified the Dockerfile with

It is now working! Great! but my build fails because I have no runtime.exs in /config. LOL!

=> ERROR [builder 15/17] COPY config/runtime.exs config/                                                                                                                                                                                                                 0.0s
 > [builder 15/17] COPY config/runtime.exs config/:
Error error building: failed to compute cache key: "/config/runtime.exs" not found: not found

The equivalent image for Erlang 25.0.2 (instead of 25.0.3) seems to be available, so I’ve used that.


Unlike @Astund’s generated Dockerfile, mine uses ARG build-time variables:

ARG DEBIAN_VERSION=bullseye-20210902-slim


@Astund, did you sort your missing runtime.exs issue?

@DavidO Yep, the runtime.exs was just a config issue on my side! Everything runs nicely now. Thanks to all of you. :slight_smile: