Learn and Be Curious

Cloud/GEP +1

ECS 1

Cloud/GEP2018. 7. 3. 05:27































[ec2-user@ip-10-0-1-65 cats]$ sudo docker build -t cats .
Sending build context to Docker daemon  1.209MB
Step 1/9 : FROM nginx
 ---> 40960efd7b8f
Step 2/9 : EXPOSE 80
 ---> Using cache
 ---> d81f3a4ec204
Step 3/9 : RUN apt-get update -y &&   apt-get upgrade -y &&   apt-get install -y curl &&   apt-get install -y python2.7 &&   cd /tmp &&   curl -O https://bootstrap.pypa.io/get-pip.py &&   python2.7 get-pip.py &&   pip install awscli &&   rm -rf /tmp/* &&   rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 07762b5777da
Step 4/9 : COPY ./default.conf /etc/nginx/conf.d/default.conf
 ---> Using cache
 ---> e5688e077566
Step 5/9 : COPY ./index.html /usr/share/nginx/html/index.html
 ---> Using cache
 ---> 3de0fcad04be
Step 6/9 : ENV BUCKET_CATS_DOGS="syd-ecs-cats/cats"
 ---> Using cache
 ---> 43380a8571e5
Step 7/9 : ENV REGION="us-east-1"
 ---> Using cache
 ---> 715398fd2663
Step 8/9 : COPY ./tmp/* /usr/share/nginx/html/
 ---> 1e943f16706b
Step 9/9 : CMD nginx -g "daemon off;"
 ---> Running in 8f3ffaefda3f
Removing intermediate container 8f3ffaefda3f
 ---> c7c8e1429608
Successfully built c7c8e1429608
Successfully tagged cats:latest






[ec2-user@ip-10-0-1-65 docker]$ docker build -t dogs .
Sending build context to Docker daemon  1.239MB
Step 1/9 : FROM httpd
 ---> 74ad7f48867f
Step 2/9 : EXPOSE 80
 ---> Using cache
 ---> fb9e7d4b4bf9
Step 3/9 : RUN apt-get update -y &&   apt-get upgrade -y &&   apt-get install -y curl &&   apt-get install -y python2.7 &&   cd /tmp &&   curl -O https://bootstrap.pypa.io/get-pip.py &&   python2.7 get-pip.py &&   pip install awscli &&   rm -rf /tmp/* &&   rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 7d342ee4389f
Step 4/9 : COPY ./httpd.conf /usr/local/apache2/conf/
 ---> Using cache
 ---> a87f2e33e720
Step 5/9 : COPY ./index.html /usr/local/apache2/htdocs/
 ---> Using cache
 ---> a645ba51b3d2
Step 6/9 : ENV BUCKET_CATS_DOGS="syd-ecs-dogs/dogs"
 ---> Using cache
 ---> 41e5dee4e4a1
Step 7/9 : ENV REGION="us-east-1"
 ---> Using cache
 ---> 8050f4295358
Step 8/9 : COPY ./tmp/ /usr/local/apache2/htdocs/
 ---> 84b46f953260
Step 9/9 : CMD httpd -D FOREGROUND
 ---> Running in 77cc81f567da
Removing intermediate container 77cc81f567da
 ---> e24a64698370
Successfully built e24a64698370
Successfully tagged dogs:latest









[root@ip-10-0-1-65 ~]# docker login -u AWS -p

sdfsdgsdfg== https://297062999199.dkr.ecr.us-east-1.amazonaws.com
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded

[root@ip-10-0-1-65 ~]# docker images
REPOSITORY                                                                 TAG                 IMAGE ID            CREATED             SIZE
dogs                                                                       latest              e24a64698370        23 minutes ago      303MB
297062999199.dkr.ecr.us-east-1.amazonaws.com/cats                          latest              c7c8e1429608        29 minutes ago      289MB
cats                                                                       latest              c7c8e1429608        29 minutes ago      289MB
<none>                                                                     <none>              3b903f3dc262        35 minutes ago      288MB
<none>                                                                     <none>              6d5d7326ea7f        About an hour ago   288MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/dogstest2                latest              30383a9fee6d        6 months ago        271MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/catstest2                latest              e89eae83e6e9        6 months ago        214MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/cat                      latest              4a12659d75a6        7 months ago        214MB
cat                                                                        latest              4a12659d75a6        7 months ago        214MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/microservice_webserver   latest              4a8bf86543aa        7 months ago        883MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/web                      latest              4a8bf86543aa        7 months ago        883MB
mustacheme_webserver                                                       latest              4a8bf86543aa        7 months ago        883MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/microservice_processor   latest              4b89382d6c39        7 months ago        936MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/proc                     latest              4b89382d6c39        7 months ago        936MB
mustacheme_processor                                                       latest              4b89382d6c39        7 months ago        936MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/info                     latest              72802221913e        7 months ago        936MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/microservice_info        latest              72802221913e        7 months ago        936MB
mustacheme_info                                                            latest              72802221913e        7 months ago        936MB
mustacheme                                                                 base                db7a546a8618        7 months ago        904MB
python                                                                     2.7                 bd2db1324f76        8 months ago        681MB
nginx                                                                      latest              40960efd7b8f        8 months ago        108MB
httpd                                                                      latest              74ad7f48867f        8 months ago        177MB
<none>                                                                     <none>              a09b06e2c67d        12 months ago       750MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/cats                     latest              1d7b7b94aef8        14 months ago       264MB
289303096751.dkr.ecr.eu-west-1.amazonaws.com/cats                          v2                  1d7b7b94aef8        14 months ago       264MB
289303096751.dkr.ecr.eu-west-1.amazonaws.com/cats                          v1                  759c05be3b65        15 months ago       279MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/dogs                     latest              e99986f084c3        15 months ago       270MB
289303096751.dkr.ecr.eu-west-1.amazonaws.com/dogs                          v1                  e99986f084c3        15 months ago       270MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/webtest2                 latest              40ce661d38c9        15 months ago       233MB
289303096751.dkr.ecr.eu-west-1.amazonaws.com/simplehomepage                latest              40ce661d38c9        15 months ago       233MB
289303096751.dkr.ecr.ap-northeast-2.amazonaws.com/homepage                 latest              40ce661d38c9        15 months ago       233MB
golang                                                                     1.6                 63330314bb46        17 months ago       749MB
awsbootcamp/mustachemebase                                                 latest              d66168c8f79d        21 months ago       881MB


[root@ip-10-0-1-65 ~]# docker push 297062999199.dkr.ecr.us-east-1.amazonaws.com/cats:latest
The push refers to repository [297062999199.dkr.ecr.us-east-1.amazonaws.com/cats]
13fec6af1466: Pushed
4eba00859455: Pushed
887d54fde2e0: Pushed
5e2d525e5c7b: Pushed
f4cc3366d6a9: Pushed
bba7659ae2e7: Pushed
cec7521cdf36: Pushed
latest: digest: sha256:fdfc33e39952409beb3ed6f1b052df7a09db73f085486139b0c3d390cc0ef723 size: 1785

[root@ip-10-0-1-65 ~]# docker tag dogs:latest 297062999199.dkr.ecr.us-east-1.amazonaws.com/dogs:latest
[root@ip-10-0-1-65 ~]# docker push 297062999199.dkr.ecr.us-east-1.amazonaws.com/dogs:latest

The push refers to repository [297062999199.dkr.ecr.us-east-1.amazonaws.com/dogs]
ccf4ea48feb6: Pushed
90ce5a6482ea: Pushed
8c4391ed9234: Pushed
e7ae8afa7c68: Pushed
607cc31ddf99: Pushed
4bb682cd39bd: Pushed
aa6b8cb0f3ac: Pushed
9ff764a04f48: Pushed
607e4dd85443: Pushed
fc59c7018530: Pushed
c01c63c6823d: Pushed
latest: digest: sha256:dd80fa4236afbe347bc13aca2bb6e0a98a4c0b1d32b7a3869e28cd3a024ba598 size: 2618
















2