■ はじめに
https://dk521123.hatenablog.com/entry/2020/05/22/165711
https://dk521123.hatenablog.com/entry/2020/05/26/142645
https://dk521123.hatenablog.com/entry/2020/05/23/080655
で起こったトラブルシューティングを纏める。
目次
【1】エラー「BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE」が表示される 【2】 エラー「Got permission denied while trying to connect to the Docker daemon socket」が発生
【1】エラー「BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE」が表示される
https://dk521123.hatenablog.com/entry/2020/05/23/080655
で発生した問題。
エラー内容
BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE: Unable to pull customer's container image. CannotPullContainerError: Error response from daemon: pull access denied for xxxx.xxx.ecr.us-west-2.amazonaws.com/hello-world-ecr. repository does not exist or may require 'docker-login': denied: User:arn:xxxxx
より抜粋 ~~~~ AWS CodeBuild には、Amazon Elastic Container Registry (Amazon ECR) から ビルドイメージを取得するアクセス許可がありません。 ~~~~
解決案
https://dk521123.hatenablog.com/entry/2020/05/23/080655
の手順「【1】ECRの画面からCodeBuildのロールに対して、許可を行う」 を行う。
【2】 エラー「Got permission denied while trying to connect to the Docker daemon socket」が発生
https://dk521123.hatenablog.com/entry/2020/05/22/165711
https://dk521123.hatenablog.com/entry/2020/05/26/142645
で発生した問題。 Amazon ECR レジストリに対してログイン時に 以下のエラー内容が発生した
エラー内容
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/vX.XX/images/create?fromImage=python&tag=latest: dial unix /var/run/docker.sock: connect: permission denied
原因
sudo なしの設定を行っていなかったため
解決案
https://dk521123.hatenablog.com/entry/2020/05/22/165711
の「2-4)docker を sudo なしで実行できるように設定する」 を行う
参考文献
https://tech.librastudio.co.jp/entry/index.php/2018/07/14/post-1924/
関連記事
Amazon ECR ~ 入門編 ~
https://dk521123.hatenablog.com/entry/2020/05/22/165711
Amazon ECR ~ 基本編 ~
https://dk521123.hatenablog.com/entry/2020/05/26/142645
CodeBuild で カスタムDockerイメージを使ってビルドする
https://dk521123.hatenablog.com/entry/2020/05/23/080655