0

I have just clone the API Platform project and when I try to build the Dockerfile I got the error: Error response from daemon: dockerfile parse error line 74: Unknown flag: link which correspond to this line in the Dockerfile:

COPY --link docker/php/conf.d/app.ini $PHP_INI_DIR/conf.d/

Might be a similar error of Error response from daemon: Dockerfile parse error Unknown flag: mount ?

Do you know how to fix this ?

Thank you !

Lenny4
  • 1,215
  • 1
  • 14
  • 33
  • The post you linked to suggests one cause is an out of date Docker version. `--link` was added in dockerfile syntax v1.4. What version of Docker are you running? – Phil Sep 28 '22 at 00:51
  • Docker version 20.10.18, build b40c2f6 – Lenny4 Sep 28 '22 at 00:52
  • Are you using the classic builder backend or [BuildKit](https://docs.docker.com/engine/reference/builder/#buildkit)? If the latter, you might want to add `# syntax=docker/dockerfile:1` – Phil Sep 28 '22 at 00:55
  • I'm using the classic build but anyway if you look at the Dockerfile in the Api platform project at the first line `#syntax=docker/dockerfile:1.4` – Lenny4 Sep 28 '22 at 01:00
  • 1
    How are you building the image? Are you running `docker compose build` or `docker-compose build`? I get different answers for `docker compose version` and `docker-compose --version` and would always recommend using `docker compose` as that is now standard – Phil Sep 28 '22 at 01:05
  • 1
    I was using `docker-compose`, I tried with `docker compose` and I don't have the error anymore. Thank you ! – Lenny4 Sep 28 '22 at 01:11

0 Answers0