devcontainerのビルドが "failed to solve: xxxxx: error getting credentials ..." で失敗するときの対処

下記のようなエラーで失敗するとき

```
[2024-01-26T08:42:25.867Z] failed to solve: mysql:8: error getting credentials - err: exec: "docker-credential-dev-containers-4c2c852b-8420-4b6d-88aa-4b6a292296b3": executable file not found in $PATH, out: ``
[2024-01-26T08:42:25.872Z] Stop (958 ms): Run: docker-compose --project-name sample_devcontainer -f /home/ec2-user/sample/.devcontainer/docker-compose.yml -f /tmp/devcontainercli-ec2-user/docker-compose/docker-compose.devcontainer.build-1706258544913.yml build main localstack mysql
[2024-01-26T08:42:25.904Z] Error: Command failed: docker-compose --project-name sample_devcontainer -f /home/ec2-user/sample/.devcontainer/docker-compose.yml -f /tmp/devcontainercli-ec2-user/docker-compose/docker-compose.devcontainer.build-1706258544913.yml build main localstack mysql
[2024-01-26T08:42:25.905Z]     at pw (/home/ec2-user/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:427:522)
[2024-01-26T08:42:25.905Z]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[2024-01-26T08:42:25.905Z]     at async L$ (/home/ec2-user/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:427:2493)
[2024-01-26T08:42:25.905Z]     at async N$ (/home/ec2-user/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:409:3165)
[2024-01-26T08:42:25.905Z]     at async tAA (/home/ec2-user/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:479:3833)
[2024-01-26T08:42:25.905Z]     at async CC (/home/ec2-user/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:479:4775)
[2024-01-26T08:42:25.905Z]     at async NeA (/home/ec2-user/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:612:11107)
[2024-01-26T08:42:25.905Z]     at async MeA (/home/ec2-user/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js:612:10848)
[2024-01-26T08:42:25.933Z] Stop (4066 ms): Run: /home/ec2-user/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681/node /home/ec2-user/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-91e073fd-7d45-4fa6-b2d7-f1a77fd208431706258534430 --workspace-folder /home/ec2-user/sample --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/ec2-user/sample --id-label devcontainer.config_file=/home/ec2-user/sample/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/ec2-user/sample/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root
[2024-01-26T08:42:25.934Z] Exit code 1
[2024-01-26T08:42:25.940Z] Command failed: /home/ec2-user/.vscode-server/bin/8b3775030ed1a69b13e4f4c628c612102e30a681/node /home/ec2-user/.vscode-remote-containers/dist/dev-containers-cli-0.327.0/dist/spec-node/devContainersSpecCLI.js up --container-session-data-folder /tmp/devcontainers-91e073fd-7d45-4fa6-b2d7-f1a77fd208431706258534430 --workspace-folder /home/ec2-user/sample --workspace-mount-consistency cached --id-label devcontainer.local_folder=/home/ec2-user/sample --id-label devcontainer.config_file=/home/ec2-user/sample/.devcontainer/devcontainer.json --log-level debug --log-format json --config /home/ec2-user/sample/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root
[2024-01-26T08:42:25.940Z] Exit code 1
```

`vim ~/.docker/config.json` の `credsStore` を削除することで解決できる。


```
        },
        "credsStore": "dev-containers-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"
}
```

devcontainer で dind(dood) をやりたい場合は、ホストの `~/.docker/` をdevcontainerにマウントすることになるので、 `devcontainer.json` の `postAttachCommand` に下記の設定を入れると、devcontainer起動時に自動的に ` ~/.docker/config.json` の `credsStore` を削除できる。


```devcontainer.json
{
  "postAttachCommand": "cat ~/.docker/config.json | jq -r 'del(.credsStore)' | tee ~/.docker/config.json"
}
```