bentoml containarize fails with "Unknown flag: mount"

263 views Asked by At

I'm trying to run 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 preppend 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 tmp file that is deleted after the failure.

What should I do to fix this problem?

1

There are 1 answers

0
neves On BEST ANSWER

I managed to pass this step turning off 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.

If someone post a better answer I'll select it as correct.