Docker Day-31,32

Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications. By taking advantage of Docker's methodologies for shipping, testing, and deploying code, you can significantly reduce the delay between writing code and running it in production.

Day-31

Install Docker

To install Docker on Amazon Linux, you can use the following command:

Verifying the Docker version

Starting the Docker service

Enable docker automatically when system starts

verify the docker running or not

List docker images

List of running container

List out all container (running and not running)

Create and run a container

Right now see we inside container

now see our base machine aws linux but see we are inside container; now see the OS version is ubuntu because we are inside container

Exit

now come out container now see the OS version

now list out images

list out running container

List out all container

Let me create one more container

exit

list out images

list out running container

list out all container

Rename a container

Now see container rename done; list out all container

search ubuntu image

To pull the image

list out images

create a container using chef image

list out all container

create a container using name as saicontainer

exit

Verify saicontainer created or not

start container

verify whether running or not

go inside container

exit

now check container running or not

again start a container

stop a container

delete a container

verify whether delete or not

Day-31 done

Day-32

Create a container

just verify i am inside my container

update

Install git

Goto tmp dir create a directory testdir and create a file testfile

Create a image from container

See the docker images

Create a container using existing image. in this image we already installed git,create directory testdir and create file called testfile; after create a image verify whether thinks are available or not

update

Verify whether git is there or not Which

Check git version

Check

Create a image from dockerfile

Create a Dockerfile

Dockerfile add some instruction "Hi Sundar"

now create image(image name test) using Dockerfile; build a image

See the test image

now create test image to run a container(name testcontainer)

Now we check already create directory called tmp and testfile found or not; go to tmp directory

See the file content

Exit

Edit dockerfile

Add more content in this Dockerfile

Create raj file

Create multiple directory

install tree

use tree command

Create a file in dirc

Create a tar file

list

remove dira

list

run this Dockerfile

Create a container using image(name mytestimage)

View os

ls

verify testfile content

Verify rajfile

update

install tree

ls

tree

Now wherever give $myname that replacing myname as sundar

Docker volume

list

i want different name for the Dockerfile Copy

See instruction of the file

Create docker image from dockerfile (Docker filename sundockerfile)

Image created

Modify the sundockerfile

original sundockerfile

After edit

Modify existing image

view images

install git

keep all docker file in one location

make dir

Move files

ls

change location

initialize git

ls see git is there

git add

git commit

Add git username,email

Create a repository

push below two docker files to git

git add

git push

git password take this location

see two are pushed