by XDK
25. August 2019 17:17
Explanation:
Login to the Docker Hub from the command line
ubuntu@ip-172-31-59-138:/opt/HelloWorld$ docker login --username=xdkdockerhub
Password:
WARNING! Your password will be stored unencrypted in /home/ubuntu/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
Command to pull the image from the docker hub repository.
ubuntu@ip-172-31-59-138:/opt/HelloWorld$ docker pull xdkdockerhub/xdkdockerrepo:xdk_helloworld_V1
xdk_helloworld_V1: Pulling from xdkdockerhub/xdkdockerrepo
c5e155d5a1d1: Already exists
221d80d00ae9: Already exists
4250b3117dca: Already exists
d1370422ab93: Already exists
deb6b03222ca: Already exists
9cdea8d70cc3: Already exists
968505be14db: Already exists
04b5c270ac81: Already exists
301d76fcab1f: Already exists
57ca7a0b9e79: Already exists
3c1d6826d7a3: Already exists
24ab01b57aed: Pull complete
Digest: sha256:47252a9c0bf7f4fe9a024ab69a7d709db3d27d409cbc66dfcddcfc1a20a04cda
Status: Downloaded newer image for xdkdockerhub/xdkdockerrepo:xdk_helloworld_V1
Verify the image.
ubuntu@ip-172-31-59-138:/opt/HelloWorld$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
xdkdockerhub/xdkdockerrepo xdk_helloworld_V1 a801afaa1782 39 minutes ago 473MB
tomcat jre8 3639174793ba 3 months ago 463MB
Command to run the xdk_helloworld docker image and change the container to listen to port 80 instead of tomcat's default port 8080 at runtime.
ubuntu@ip-172-31-59-138:/opt/HelloWorld$ docker run -p 80:8080 xdkdockerhub/xdkdockerrepo:xdk_helloworld_V1
Open http://34.204.171.134/HelloWorld/ in a browser to see the HelloWorld web is application running.