Skip to content
Latchkey

Dockerfile "ADD requires at least two arguments" in CI

The Dockerfile parser rejected an ADD that has only one argument. Like COPY, ADD needs both a source and a destination, so a single token leaves the destination undetermined.

What this error means

docker build fails at parse time with "ADD requires at least two arguments, but only one was provided. Destination could not be determined."

docker build
ADD requires at least two arguments, but only one was provided.
Destination could not be determined.

Common causes

Missing destination argument

The instruction is written as ADD file.tar.gz with no destination, so there is nowhere to extract or place it.

An unexpanded variable removed the destination

A build ARG that resolved to empty collapsed the arguments to one.

How to fix it

Provide a destination

Give ADD both a source and a destination path.

Dockerfile
ADD release.tar.gz /opt/app/

Prefer COPY unless you need ADD features

Use COPY for plain files; reserve ADD for local tar extraction, with an explicit destination.

Dockerfile
COPY app.py /app/

How to prevent it

  • Always write ADD with an explicit destination.
  • Use COPY for plain files and ADD only for tar extraction.
  • Confirm build args used in paths are defined.

Frequently asked questions

What causes ""ADD requires at least two arguments""?
The instruction is written as ADD file.tar.gz with no destination, so there is nowhere to extract or place it.
How do I fix "ADD requires at least two arguments"?
Give ADD both a source and a destination path.

Related guides

References

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