Dockerをプロキシサーバーがある環境で使う際に出たエラーの紹介です。
プロキシの設定
Dockerはイメージのダウンロードとかで色々とインターネット上のサーバーと通信するのでプロキシの設定が必要です。Dockerにプロキシ設定用の画面があるのでそこで適切にプロキシを設定します。

設定しないでイメージ(例はCentOS)を持って来ようとすると以下のようなエラーが発生します。
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to do request: Head "https://registry-1.docker.io/v2/library/centos/manifests/7": dial tcp 52.20.81.6:443: connect: connection refused
Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Buildkitの無効化
Dockerの設定画面でDocker Engineのタブを開き、buildkitをfalseにします。

よく分かりませんがこれが無いと以下の様なエラーが発生します。バージョン18.09からデフォルトで有効になった機能でビルドが高速化されたりするそうですが残念ながら使えませんでした。
failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to authorize: rpc error: code = Unknown desc = failed to fetch anonymous token: Get "https://auth.docker.io/token?scope=repository%3Alibrary%2Fcentos%3Apull&service=registry.docker.io": dial tcp 3.224.96.239:443: connectex: No connection could be made because the target machine actively refused it.
