Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #---------------------------------------------------- httpd image pull --------------------------------------------#
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image pull httpd:alpine
- alpine: Pulling from library/httpd
- 8a49fdb3b6a5: Already exists
- beb66a906b34: Already exists
- 01924573e8db: Already exists
- 255f194b76b3: Already exists
- 0f48f8ea2bc9: Already exists
- 390cbd08c8ae: Already exists
- Digest: sha256:3e25d419bf180122f5f9af5cf2180709d8234320ff25514a61f5d1bc3cf46394
- Status: Downloaded newer image for httpd:alpine
- docker.io/library/httpd:alpine
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image ls
- REPOSITORY TAG IMAGE ID CREATED SIZE
- httpd alpine d7544b312621 13 days ago 59.1MB
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker container run --name test -d httpd:alpine
- afeaa05d87dcd717170052185601280201ab00d38fe9c86d301fe026d06ee19c
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker container cp test:/usr/local/apache2/conf/httpd.conf .
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$ ls
- httpd.conf site1
- #---------------------------------------------------- Image Creation --------------------------------------------#
- [ec2-user@ip-172-31-41-59 docker-pull]$ cat Dockerfile
- FROM httpd:alpine
- COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf
- COPY ./site1/ /usr/local/apache2/htdocs/
- CMD ["httpd-foreground"]
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image build -t productionapp:1 .
- Sending build context to Docker daemon 2.529MB
- Step 1/4 : FROM httpd:alpine
- ---> d7544b312621
- Step 2/4 : COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf
- ---> 719c2d98bd10
- Step 3/4 : COPY ./site1/ /usr/local/apache2/htdocs/
- ---> 6434da0e48be
- Step 4/4 : CMD ["httpd-foreground"]
- ---> Running in 35c3ecc051bc
- Removing intermediate container 35c3ecc051bc
- ---> 7ac4702dd0e4
- Successfully built 7ac4702dd0e4
- Successfully tagged productionapp:1
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image ls
- REPOSITORY TAG IMAGE ID CREATED SIZE
- productionapp 1 7ac4702dd0e4 10 seconds ago 61.6MB
- httpd alpine d7544b312621 13 days ago 59.1MB
- #---------------------------------------------------- Image pull --------------------------------------------#
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image tag productionapp:1 chrisluiz16/productionapp:1
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image push chrisluiz16/productionapp:1
- The push refers to repository [docker.io/chrisluiz16/productionapp]
- 6f49d5628596: Pushed
- 9f55559c2658: Pushed
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image push chrisluiz16/productionapp:latest
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image ls
- REPOSITORY TAG IMAGE ID CREATED SIZE
- chrisluiz16/productionapp 1 7ac4702dd0e4 11 minutes ago 61.6MB
- productionapp 1 7ac4702dd0e4 7 minutes ago 61.6MB
- httpd alpine d7544b312621 13 days ago 59.1MB
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image tag chrisluiz16/productionapp:1 chrisluiz16/productionapp:latest
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image ls
- REPOSITORY TAG IMAGE ID CREATED SIZE
- chrisluiz16/productionapp 1 7ac4702dd0e4 7 minutes ago 61.6MB
- chrisluiz16/productionapp latest 7ac4702dd0e4 7 minutes ago 61.6MB
- productionapp 1 7ac4702dd0e4 7 minutes ago 61.6MB
- httpd alpine d7544b312621 13 days ago 59.1MB
- #---------------------------------------------------- Client machine container creation --------------------------------------------#
- [ec2-user@client-machine ~]$ docker image pull chrisluiz16/productionapp
- Using default tag: latest
- Status: Downloaded newer image for chrisluiz16/productionapp:latest
- docker.io/chrisluiz16/productionapp:latest
- [ec2-user@client-machine ~]$
- [ec2-user@client-machine ~]$
- [ec2-user@client-machine ~]$ docker image ls
- REPOSITORY TAG IMAGE ID CREATED SIZE
- chrisluiz16/productionapp latest 7ac4702dd0e4 11 minutes ago 61.6MB
- [ec2-user@client-machine ~]$
- [ec2-user@client-machine ~]$
- [ec2-user@client-machine ~]$ docker container run --name webserver1 -d -p 8081:80 chrisluiz16/productionapp
- b5f942cae5ef439b9a444539aab6407516aa47afad65b8574a94959ea84ac1e6
- #---------------------------------------------------- Version 2 --------------------------------------------#
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image build -t chrisluiz16/productionapp:2 .
- Sending build context to Docker daemon 2.529MB
- ---> 12c6e3622630
- Successfully built 12c6e3622630
- Successfully tagged chrisluiz16/productionapp:2
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image ls
- REPOSITORY TAG IMAGE ID CREATED SIZE
- chrisluiz16/productionapp 2 12c6e3622630 About a minute ago 61.6MB
- chrisluiz16/productionapp 1 7ac4702dd0e4 7 minutes ago 61.6MB
- chrisluiz16/productionapp latest 7ac4702dd0e4 7 minutes ago 61.6MB
- productionapp 1 7ac4702dd0e4 7 minutes ago 61.6MB
- httpd alpine d7544b312621 13 days ago 59.1MB
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image tag chrisluiz16/productionapp:2 chrisluiz16/productionapp:latest
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image ls
- REPOSITORY TAG IMAGE ID CREATED SIZE
- chrisluiz16/productionapp 2 12c6e3622630 7 minutes ago 61.6MB
- chrisluiz16/productionapp latest 12c6e3622630 7 minutes ago 61.6MB
- chrisluiz16/productionapp 1 7ac4702dd0e4 14 minutes ago 61.6MB
- productionapp 1 7ac4702dd0e4 14 minutes ago 61.6MB
- httpd alpine d7544b312621 13 days ago 59.1MB
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image push chrisluiz16/productionapp:2
- The push refers to repository [docker.io/chrisluiz16/productionapp]
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image push chrisluiz16/productionapp:latest
- The push refers to repository [docker.io/chrisluiz16/productionapp]
- #----
- ------------------------------------------------ Client machine container creation Version2 --------------------------------------------#
- ec2-user@client-machine ~]$ docker image pull chrisluiz16/productionapp
- Using default tag: latest
- latest: Pulling from chrisluiz16/productionapp
- 8a49fdb3b6a5: Already exists
- beb66a906b34: Already exists
- 01924573e8db: Already exists
- 255f194b76b3: Already exists
- 0f48f8ea2bc9: Already exists
- 390cbd08c8ae: Already exists
- 87af820e40d5: Already exists
- 6cba2c7aef59: Pull complete
- Digest: sha256:16b22770777ecde8a0621bf1794a9c6a20d75ad2cc17cccf323bc4920e5af46b
- Status: Downloaded newer image for chrisluiz16/productionapp:latest
- docker.io/chrisluiz16/productionapp:latest
- [ec2-user@client-machine ~]$ docker image ls
- REPOSITORY TAG IMAGE ID CREATED SIZE
- chrisluiz16/productionapp latest 12c6e3622630 12 minutes ago 61.6MB
- chrisluiz16/productionapp <none> 7ac4702dd0e4 19 minutes ago 61.6MB
- [ec2-user@client-machine ~]$ docker container run --name webserver2 -d -p 8082:80 chrisluiz16/productionapp
- 818bc7afa64cfbbf2a2682aa1a7810bba71f1a81ab0822adf7caf4b911d51c4c
- [ec2-user@client-machine ~]$ docker container ls -a
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- 818bc7afa64c chrisluiz16/productionapp "httpd-foreground" 20 seconds ago Up 19 seconds 0.0.0.0:8082->80/tcp, :::8082->80/tcp webserver2
- 047eabd99890 7ac4702dd0e4 "httpd-foreground" 18 minutes ago Up 18 minutes 0.0.0.0:8081->80/tcp, :::8081->80/tcp webserver1
- #---------------------------------------------------- Version 3--------------------------------------------#
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image build -t chrisluiz16/productionapp:3 .
- Sending build context to Docker daemon 2.529MB
- Step 1/4 : FROM httpd:alpine
- ---> d7544b312621
- Step 2/4 : COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf
- ---> Using cache
- ---> 2c37b84dda20
- Step 3/4 : COPY ./site1/ /usr/local/apache2/htdocs/
- ---> 31e3de60907e
- Step 4/4 : CMD ["httpd-foreground"]
- ---> Running in b6e489a7c888
- Removing intermediate container b6e489a7c888
- ---> 49a9519e8e6c
- Successfully built 49a9519e8e6c
- Successfully tagged chrisluiz16/productionapp:3
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image tag chrisluiz16/productionapp:3 chrisluiz16/productionapp:latest
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image ls
- REPOSITORY TAG IMAGE ID CREATED SIZE
- chrisluiz16/productionapp 3 49a9519e8e6c 31 seconds ago 61.6MB
- chrisluiz16/productionapp latest 49a9519e8e6c 31 seconds ago 61.6MB
- chrisluiz16/productionapp 2 12c6e3622630 17 minutes ago 61.6MB
- chrisluiz16/productionapp 1 7ac4702dd0e4 24 minutes ago 61.6MB
- productionapp 1 7ac4702dd0e4 24 minutes ago 61.6MB
- httpd alpine d7544b312621 13 days ago 59.1MB
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image push chrisluiz16/productionapp:3
- The push refers to repository [docker.io/chrisluiz16/productionapp]
- 124944b64f57: Pushed
- 06515172d06a: Layer already exists
- a98c0c13236c: Layer already exists
- 9e2cb215930a: Layer already exists
- 62b03e3606b9: Layer already exists
- 8d783d71838c: Layer already exists
- 1f6500633a39: Layer already exists
- bb01bd7e32b5: Layer already exists
- 3: digest: sha256:c6d6835c12ce9ead3720ee95f047fd6335e8dadd407267fd4ac4c11e5cea385f size: 1991
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image push chrisluiz16/productionapp:latest
- The push refers to repository [docker.io/chrisluiz16/productionapp]
- 124944b64f57: Layer already exists
- 06515172d06a: Layer already exists
- a98c0c13236c: Layer already exists
- 9e2cb215930a: Layer already exists
- 62b03e3606b9: Layer already exists
- 8d783d71838c: Layer already exists
- 1f6500633a39: Layer already exists
- bb01bd7e32b5: Layer already exists
- latest: digest: sha256:c6d6835c12ce9ead3720ee95f047fd6335e8dadd407267fd4ac4c11e5cea385f size: 1991
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$
- [ec2-user@ip-172-31-41-59 docker-pull]$ docker image ls
- REPOSITORY TAG IMAGE ID CREATED SIZE
- chrisluiz16/productionapp 3 49a9519e8e6c About a minute ago 61.6MB
- chrisluiz16/productionapp latest 49a9519e8e6c About a minute ago 61.6MB
- chrisluiz16/productionapp 2 12c6e3622630 18 minutes ago 61.6MB
- chrisluiz16/productionapp 1 7ac4702dd0e4 25 minutes ago 61.6MB
- productionapp 1 7ac4702dd0e4 25 minutes ago 61.6MB
- httpd alpine d7544b312621 13 days ago 59.1MB
- #---------------------------------------------------- Client machine container creation Version3 --------------------------------------------#
- [ec2-user@client-machine ~]$ docker image pull chrisluiz16/productionapp
- Using default tag: latest
- latest: Pulling from chrisluiz16/productionapp
- 8a49fdb3b6a5: Already exists
- beb66a906b34: Already exists
- 01924573e8db: Already exists
- 255f194b76b3: Already exists
- 0f48f8ea2bc9: Already exists
- 390cbd08c8ae: Already exists
- 87af820e40d5: Already exists
- 00328d0116e0: Pull complete
- Digest: sha256:c6d6835c12ce9ead3720ee95f047fd6335e8dadd407267fd4ac4c11e5cea385f
- Status: Downloaded newer image for chrisluiz16/productionapp:latest
- docker.io/chrisluiz16/productionapp:latest
- [ec2-user@client-machine ~]$
- [ec2-user@client-machine ~]$
- [ec2-user@client-machine ~]$ docker image ls
- REPOSITORY TAG IMAGE ID CREATED SIZE
- chrisluiz16/productionapp latest 49a9519e8e6c 2 minutes ago 61.6MB
- chrisluiz16/productionapp <none> 12c6e3622630 19 minutes ago 61.6MB
- chrisluiz16/productionapp <none> 7ac4702dd0e4 26 minutes ago 61.6MB
- [ec2-user@client-machine ~]$ docker container run --name webserver3 -d -p 8083:80 chrisluiz16/productionapp
- 81ba7d219a5c73def357ccbe8443e4ee65a30c26ce7578798b3c9927bda1c305
- [ec2-user@client-machine ~]$
- [ec2-user@client-machine ~]$ docker container ls -a
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- 81ba7d219a5c chrisluiz16/productionapp "httpd-foreground" 30 seconds ago Up 28 seconds 0.0.0.0:8083->80/tcp, :::8083->80/tcp webserver3
- 818bc7afa64c 12c6e3622630 "httpd-foreground" 7 minutes ago Up 7 minutes 0.0.0.0:8082->80/tcp, :::8082->80/tcp webserver2
- 047eabd99890 7ac4702dd0e4 "httpd-foreground" 26 minutes ago Up 26 minutes 0.0.0.0:8081->80/tcp, :::8081->80/tcp webserver1
- [ec2-user@client-machine ~]$
- #---------------------------------------------------- Removing all Dangling image --------------------------------------------#
- [ec2-user@client-machine ~]$ docker image ls -a
- REPOSITORY TAG IMAGE ID CREATED SIZE
- chrisluiz16/productionapp latest 49a9519e8e6c 8 minutes ago 61.6MB
- chrisluiz16/productionapp <none> 12c6e3622630 25 minutes ago 61.6MB
- chrisluiz16/productionapp <none> 7ac4702dd0e4 31 minutes ago 61.6MB
- [ec2-user@client-machine ~]$
- [ec2-user@client-machine ~]$
- [ec2-user@client-machine ~]$ docker container stop webserver1 webserver2
- webserver1
- webserver2
- [ec2-user@client-machine ~]$ docker container rm webserver1 webserver2
- webserver1
- webserver2
- [ec2-user@client-machine ~]$ docker image prune
- WARNING! This will remove all dangling images.
- Are you sure you want to continue? [y/N] y
- Deleted Images:
- untagged: chrisluiz16/productionapp@sha256:d6abbc2d051659d7c0e01d5d387b8b9951cb9b81e795d79778e6ae4fa56f8df1
- deleted: sha256:7ac4702dd0e4aa5d9f3be28d48044b40740a634ea37216b880af0ccb29cc7709
- deleted: sha256:c8d29022145b067324f2e581ce42264bb57c6f65d272e7148ad6f8aa0d5e346b
- untagged: chrisluiz16/productionapp@sha256:16b22770777ecde8a0621bf1794a9c6a20d75ad2cc17cccf323bc4920e5af46b
- deleted: sha256:12c6e3622630c8ee9a83cd5e90711591a680d7b5754f0bd66ff82f66b5ed035b
- deleted: sha256:9392e80e1ab3e875b728b0ed09f1fb485f2bdc0f453184256928350b4f3a06c8
- Total reclaimed space: 4.961MB
- [ec2-user@client-machine ~]$ docker image ls -a
- REPOSITORY TAG IMAGE ID CREATED SIZE
- chrisluiz16/productionapp latest 49a9519e8e6c 9 minutes ago 61.6MB
- [ec2-user@client-machine ~]$
Advertisement
Add Comment
Please, Sign In to add comment