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".
ADD failed: failed to GET https://example.com/releases/app.tar.gz with status 404 Not FoundCommon 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
- Open the URL to confirm it still returns the file.
- Update the ADD to the current, stable URL.
- 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.
RUN curl -fsSL https://example.com/releases/app.tar.gz -o /tmp/app.tar.gz \
&& tar -xzf /tmp/app.tar.gz -C /optHow to prevent it
- Pin remote URLs to stable, versioned release paths.
- Use
RUN curl -fso a non-2xx status fails the build clearly. - Ensure the build environment has DNS and egress to required hosts.