I’m having trouble deploying an Elixir Phoenix application. The first deploy works, then subsequent deploys fail like this:
[+] Building 4.5s (15/30)
=> [internal] load build definition from Dockerfile 0.6s
=> => transferring dockerfile: 2.86kB 0.6s
=> [internal] load metadata for docker.io/library/debian:bookworm-20250811-slim 0.2s
=> [internal] load metadata for docker.io/hexpm/elixir:1.18.4-erlang-27.3.4.2-debian-bookworm-20250811-slim 0.2s
=> [internal] load .dockerignore 0.6s
=> => transferring context: 1.45kB 0.6s
=> [builder 1/19] FROM docker.io/hexpm/elixir:1.18.4-erlang-27.3.4.2-debian-bookworm-20250811-slim@sha256:3dd20810ad4a95b077e5e90675f1aa45a025f925ed118bd932371c43a4e2e7ea 0.0s
=> => resolve docker.io/hexpm/elixir:1.18.4-erlang-27.3.4.2-debian-bookworm-20250811-slim@sha256:3dd20810ad4a95b077e5e90675f1aa45a025f925ed118bd932371c43a4e2e7ea 0.0s
=> [final 1/6] FROM docker.io/library/debian:bookworm-20250811-slim@sha256:b1a741487078b369e78119849663d7f1a5341ef2768798f7b7406c4240f86aef 0.0s
=> => resolve docker.io/library/debian:bookworm-20250811-slim@sha256:b1a741487078b369e78119849663d7f1a5341ef2768798f7b7406c4240f86aef 0.0s
=> [internal] load build context 3.1s
=> => transferring context: 66.54kB 1.0s
=> CACHED [builder 2/19] RUN apt-get update && apt-get install -y --no-install-recommends build-essential git && rm -rf /var/lib/apt/lists/* 0.0s
=> CACHED [builder 3/19] WORKDIR /app 0.0s
=> CACHED [builder 4/19] RUN mix local.hex --force && mix local.rebar --force 0.0s
=> CACHED [builder 5/19] COPY mix.exs mix.lock ./ 0.0s
=> CACHED [builder 6/19] RUN mix deps.get --only prod 0.0s
=> CACHED [builder 7/19] RUN mkdir config 0.0s
=> CACHED [builder 8/19] COPY config/config.exs config/prod.exs config/ 0.0s
=> CACHED [builder 9/19] RUN mix deps.compile 0.0s
=> ERROR [builder 10/19] RUN mix assets.setup 1.8s
------
> [builder 10/19] RUN mix assets.setup:
0.713
0.713 04:42:55.294 [debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v4.1.12/tailwindcss-linux-x64
1.774 ** (RuntimeError) Couldn't fetch https://github.com/tailwindlabs/tailwindcss/releases/download/v4.1.12/tailwindcss-linux-x64: {true, {:error, {:shutdown, :server_closed}}}
1.774
1.774 This typically means we cannot reach the source or you are behind a proxy.
1.774 You can try again later and, if that does not work, you might:
1.774
1.774 1. If behind a proxy, ensure your proxy is configured and that
1.774 your certificates are set via OTP ca certfile overide via SSL configuration.
1.774
1.774 2. Manually download the executable from the URL above and
1.774 place it at "_build/tailwind-linux-x64"
1.774
1.774 3. Install and use Tailwind from npmJS. See our module documentation
1.774 to learn more: https://hexdocs.pm/tailwind
1.774
1.774 (tailwind 0.4.1) lib/tailwind.ex:383: Tailwind.fetch_body!/2
1.774 (tailwind 0.4.1) lib/tailwind.ex:250: Tailwind.install/1
1.774 (mix 1.18.4) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5
1.774 (mix 1.18.4) lib/mix/task.ex:561: Mix.Task.run_alias/6
1.774 (mix 1.18.4) lib/mix/cli.ex:107: Mix.CLI.run_task/2
1.774 /usr/local/bin/mix:2: (file)
------
Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c mix assets.setup" did not complete successfully: exit code: 1
I found this post which suggested doing fly deploy –build-only but that gets the same error.
Any ideas on why this works once, then fails?
TIA,
Martin