Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 33 You must be signed in to star a gist
  • Fork 54 You must be signed in to fork a gist
  • Save awssimplified/da49577fa48128e1da992dd6ec21085c to your computer and use it in GitHub Desktop.
Save awssimplified/da49577fa48128e1da992dd6ec21085c to your computer and use it in GitHub Desktop.
Commands
------------
1. Build Docker Image
docker build -t test .
2. Run container /w image
docker run -d --publish 8888:5000 test
3. Login to ECR
aws ecr get-login-password --region REGIONHERE!!!! | docker login --username AWS --password-stdin ACCOUNTIDHERE!!!!.dkr.ecr.REGIONHERE!!!.amazonaws.com
4. Tag the version
docker tag test:latest YOURACCOUNT.dkr.ecr.YOURREGION-1.amazonaws.com/YOURREPO:YOURTAG
5. Upload
docker push YOURACCOUNT.dkr.ecr.YOURREGION.amazonaws.com/YOURREPO:YOURTAG
Policy Document
-----------
ECR
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "ecr:*",
"Resource": "*"
},
{
"Sid": "VisualEditor01",
"Effect": "Allow",
"Action": "ecr:GetAuthorizationToken",
"Resource": "*"
},
{
"Sid": "VisualEditor02",
"Effect": "Allow",
"Action": "ecr:InitiateLayerUpload",
"Resource": "*"
}
]
}
ECS
arn:aws:iam::aws:policy/AmazonECS_FullAccess
@musahaidari
Copy link

Thanks, but would have been great if you have included the dockerfile too.

@rmb305
Copy link

rmb305 commented Feb 21, 2021

Yes, please.

@andresdigi25
Copy link

Where is the python api code?

@towardsuffering
Copy link

Thanks, but would have been great if you have included the dockerfile too.

https://docker-curriculum.com/

@BoscarAyala
Copy link

can you pls provide .py code .. thanks for your time.

@popkarthb
Copy link

popkarthb commented Nov 1, 2022

Show Random Cat py

#Simplest app.py code for demo
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
    return "<img src=https://cataas.com/cat>"
if __name__ == "__main__":
    app.run(host="0.0.0.0",port=5000)

@psaumur
Copy link

psaumur commented Sep 28, 2023

Where is the python api code?

In the git repo from the docker curriculum link (posted within the youTube video description)
git clone https://github.com/prakhar1989/docker-curriculum.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment