Docker to AWS, A journey

I am following this lecture to build from here: https://amigoscode.com/courses/631065/lectures/11260263

Docker Image:

Image is a template for creating an environment of your choice, snapshot, has everything to run your apps, OS, software, app code.

Below code we are pulling Apache httpd in docker desktop:

Check the images:

Run container from this image:

It will hang up so we write ctrl+c to delete it

we check with this code:

docker run

we check:

or

Docker port exposing: before that we are stopping the running container

docker stop objective_roentgen
docker stop intelligent_wiles

Now writing command for exposing the port and running the container:

d for dettach and p for port exposing t

Now the container is running perfectly and exposing the port which we can visit and check with command:

 

Now going to

will work perfectly.

It means the container port 80 is exposing to user by port 8080

Now I stopped the container:

So cannot reach to localhost:8080
Now we want to run in different port we can also follow the step:

Now we can also run multiple containers from a single command:

We stop and start again the docker container:

 

now docker help finding:

it will show like this:

removing a container from here:

we can show id  by

it will show like this:

when we need to remove running container forcefully

-f for force

Custom name for docker container:

Now stopping docker container named website

Now running again the docker container:

we check containers with command

Docker ps formatting:

 

Docker volumes: between host and controllers

pwd=present working directory

 

Spread the love