0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

DockerのImageをECRにpushするまで

Posted at

目的

DockerのイメージをAmazon ECRにpushする

手順

1. ECRのリポジトリ作成

リポジトリ名を入力して作成する
スクリーンショット 2025-01-25 23.54.33.png

2. 認証を行う

pushするECRレジストリ先にDockerクライアントを認証する必要があるので、以下のコマンドで認証を行います。

aws ecr get-login-password --region {region} | docker login --username AWS --password-stdin {aws_account_id}.dkr.ecr.{region}.amazonaws.com

region: リージョン
aws_account_id: 12桁のid

3. docker imageを作成・タグづけをする

docker buildでイメージを作成する
以下のコマンドでbuildと同時にタグづけができる

docker build -t {image}:{tag}

作成したイメージは以下のコマンドで確認できる

docker images

4. ECRにpushする

docker push {aws_account_id}.dkr.ecr.{region}.amazonaws.com/{my-repository}:{tag}

my-repository: リポジトリ名
tag: 作成したイメージタグ

ECRレジストリのリポジトリにイメージがpushされていることができたらpushh完了です!!

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?