Skip to content
Latchkey

Dockerfile "ADD failed: failed to GET ... 404" in CI

An ADD <url> <dest> instruction tried to download a remote file and the server returned a non-2xx status, or the host could not be resolved. The build stops at that instruction.

What this error means

docker build fails with "ADD failed: failed to GET https://example.com/file with status 404 Not Found", or a DNS form ending in "lookup host: no such host".

docker build
ADD failed: failed to GET https://example.com/releases/app.tar.gz with status 404 Not Found

Common causes

The URL returns a non-2xx status

The remote path moved or the release was removed, so the server answers 404 (or another error) and ADD cannot fetch it.

No egress or DNS for the build

The build network cannot resolve or reach the host, producing a "no such host" or connection failure on the ADD.

How to fix it

Fix the URL and verify reachability

  1. Open the URL to confirm it still returns the file.
  2. Update the ADD to the current, stable URL.
  3. Ensure the build has DNS and egress to that host.

Prefer RUN curl with error handling

Fetch with curl so a bad status fails loudly and you can verify checksums; ADD from a URL does not unpack and is discouraged.

Dockerfile
RUN curl -fsSL https://example.com/releases/app.tar.gz -o /tmp/app.tar.gz \
 && tar -xzf /tmp/app.tar.gz -C /opt

How to prevent it

  • Pin remote URLs to stable, versioned release paths.
  • Use RUN curl -f so a non-2xx status fails the build clearly.
  • Ensure the build environment has DNS and egress to required hosts.

Frequently asked questions

What causes ""ADD failed: failed to GET ... with status 404""?
The remote path moved or the release was removed, so the server answers 404 (or another error) and ADD cannot fetch it.
How do I fix "ADD failed: failed to GET ... with status 404"?
Fix the URL and verify reachability

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card