0
0

More than 5 years have passed since last update.

Dockerを使ってみよう-2

Posted at

今回は前の記事で作ったDocker imageをAWSのECRにプッシュします。
自分用なのでところどろこ抜けてます…

初めに

EC2 インスタンスの上にDocker imageがある
ECR Repository

pipをインストール

# curl -O https://bootstrap.pypa.io/get-pip.py
# python get-pip.py

IAMのアクセスキー作成

AWSでIAM Servicesに行きます。左のパネルにUserをクリックし自分のアカウントを見つけたら、Security Credentialsのタブを開きます。
Create Access Keyを押してアクセスキーを作ります。
アクセスキーIDとシークレットはちゃんと保存してくださいね、特にシークレットはこれ以降出てきません

Push!

ec2インスタンス 上で回収したIDとシークレットを使います

$aws config

AWS ACCESS KEY id [NONE]: コピペ
AWS SECRET ACCESS Key [NONE]: コピペ
Default region name [NONE]: リージョンを入れてください
Default output format [NONE]: エンターキー


ECRのURIをゲット

docker push 5001504xxxxx.dkr.ecr.us-west-1.amazonaws.com/repo_name

ターミナルにコピペすれば完了!

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