Build images with BuildKit returns unexpected EOF

I am having trouble using BuildKit. I am using Ubuntu 18.04 with Docker version 19.03.8, build afacb8b7f0

Dockerfile:

FROM ubuntu:18.04
RUN echo hello
RUN echo world

Command:

export DOCKER_BUILDKIT=1
docker build .

Output:

[+] Building 0.4s (4/6)                                               
 => [internal] load build definition from Dockerfile             0.0s
 => => transferring dockerfile: 37B                              0.0s
 => [internal] load .dockerignore                                0.0s
 => => transferring context: 2B                                  0.0s
 => [internal] load metadata for docker.io/library/ubuntu:18.04  0.0s
 => CACHED [1/3] FROM docker.io/library/ubuntu:18.04             0.0s
 => [2/3] RUN echo hello                                         0.4s
 => => # hello                                                       
unexpected EOF

The seconds echo command is not executed. The same Dockerfile works fine without BuildKit.

Just for anyone’s interest, I solved the issue by restarting the docker deamon…

sudo service docker restart