dockerdockerfilebentoml

BentoML containerize fails with "Unknown flag: mount"


I'm trying to run the BentoML tutorial to package and serve a machine learning model. It fails when I run bentoml containerize iris_classifier:latest

The error message is:

[+] Building 0.1s (2/2) FINISHED
 => [internal] load build definition from Dockerfile                           0.1s
 => => transferring dockerfile: 1.66kB                                         0.0s
 => [internal] load .dockerignore                                              0.0s
 => => transferring context: 2B                                                0.0s
failed to solve with frontend dockerfile.v0: failed to create LLB definition: Dockerfile parse error line 22: Unknown flag: mount

Since I'm using Docker version 19.03.9, this answer says that I must prepend the following string to the Dockefile:

# syntax=docker/dockerfile:experimental

My problem is that I can't find where is the Dockerfile that BentoML is using. It is using a temporary file that is deleted after the failure.

What should I do to fix this problem?


Solution

  • I managed to pass this step, turning off the build kit setting, the environment variable DOCKER_BUILDKIT=0

    Here is the command line:

    DOCKER_BUILDKIT=0 bentoml containerize iris_classifier:latest
    

    I've got another error, but I think it is in an advanced step and unrelated to this problem.

    I tried to edit the default Docker template, but it didn't work.