0

I am trying to build docker image from https://github.com/apache/airflow/blob/2.3.2/Dockerfile

This file has a function method defination

However getting below error Error response from daemon: dockerfile parse error line 76: unknown instruction: FUNCTION

docker version

docker --version
Docker version 20.10.7, build f0df350

It seems things are working in Mac OS but failing on Ubuntu OS

Sachin
  • 3,424
  • 3
  • 21
  • 42
  • Are you sure you didnt misplace any quotations or symbols at this line? It works fine for me. – Raja Ravindra Jun 16 '22 at 05:52
  • Yes I just copy pasted it & ran diff against it as well. @RajaRavindra what is your docker version? – Sachin Jun 16 '22 at 06:11
  • try this where you see this comment go to that location copy that file and do a copy of file directly by replacing the COPY command, this should wotk # The content below is automatically copied from scripts/docker/determine_debian_version_specific_variables.sh COPY ... – Nishant Jun 16 '22 at 07:53
  • Are your docker versions the same on ubuntu and mac? – GChuf Jun 16 '22 at 08:04
  • @Sachin `Docker version 22.06.0-beta.0, build 3e9117b` and I on Ubuntu 20.04 – Raja Ravindra Jun 16 '22 at 09:52
  • 1
    `FUNCTION` is not a [Dockerfile directive](https://docs.docker.com/engine/reference/builder/). Can you [edit] the question to include a [mcve], rather than just a link to an external resource? – David Maze Jun 16 '22 at 09:56
  • @DavidMaze I am not changing anything from above pasted docker link I just cloned the project & started executing it. I observe this is working in Mac but failing for ubuntu – Sachin Jun 16 '22 at 12:39
  • @GChuf yes it's same I even upgraded ubuntu one to docker --version Docker version 20.10.17, build 100c701 still fails – Sachin Jun 16 '22 at 12:41

1 Answers1

0

So I have the found the solution to it. Airflow requires Buildkit to build the image because airflow started using features that are only available in Buildkit.

This can be done by setting DOCKER_BUILDKIT=1 as an environment variable or by installing the buildx plugin and running docker buildx build command.

Sachin
  • 3,424
  • 3
  • 21
  • 42