Skip to content
YukiOnishi edited this page May 25, 2024 · 4 revisions

Artifact Registryにpushする方法

🔸これでいい
gcloud auth configure-docker asia-northeast1-docker.pkg.dev

docker build --platform linux/amd64 -t asia-northeast1-docker.pkg.dev/geek-picks-staging/trend-article-crawler/latest -f Dockerfile.trend-article-crawler .

- https://stackoverflow.com/questions/66920645/exec-format-error-when-running-containers-build-with-apple-m1-chip-arm-based


docker push asia-northeast1-docker.pkg.dev/geek-picks-staging/trend-article-crawler/latest


Cloud Jobの手順

  • Artifact Registryにサービスを作成
  • そのサービスと同じ名前のdocker imageをローカルに作成
🔸これでいい
gcloud auth configure-docker asia-northeast1-docker.pkg.dev

docker build --platform linux/amd64 -t asia-northeast1-docker.pkg.dev/geek-picks-staging/trend-article-crawler/latest -f Dockerfile.trend-article-crawler .

- https://stackoverflow.com/questions/66920645/exec-format-error-when-running-containers-build-with-apple-m1-chip-arm-based


docker push asia-northeast1-docker.pkg.dev/geek-picks-staging/trend-article-crawler/latest


  • pushしたらcloud run jobを指定
  • ジョブを作成で、コンテナイメージのURLをArtifact Registryにpushしたimageを指定する

環境変数を指定して、作成したら終わり

Cloud Buildを用いてCloud Runにデプロイする

権限設定が必要 https://cloud.google.com/build/docs/deploying-builds/deploy-cloud-run?hl=ja

Clone this wiki locally