Session 7 | How to create your application image in docker | How to create docker images?

Опубликовано: 28 Июль 2026
на канале: Encyclopedia Book
20
2

Keynotes Of Last Session
=========================
NA

Keynotes Of This Session
=========================

What is an docker image or docker file ?
What is container ?
container is a process which needs resources like file system, system level dependencies in order to contain an application.
container is an environment which needs to know whether it needs Linux OS or Windows OS.
Where container gets all these info from ?
the answer is docker image.
So, Image is an input to container and is a descriptive file called docker file which will instruction to create image which will decide the type of container
Docker images can be created in 2 ways
CLI - Command Line Argument.
Docker File.
How to create docker images using CLI ?
How to create docker container?
docker run --name=linux-base-container -it -p 8080:80 ubuntu
How to bring existing docker container up ?
docker exec --workdir / --user root containerID bash
How to commit container as an image ?
docker container commit -m "added-linux-base" containerID imagename
How to delete docker container ?
docker rm -f containerID
How to delete the docker image ?
docker image rm
How to list all the docker images in the system ?
docker image ls
How to see the image layering ?
docker image history imageID
What is image layering ?
Why images are immutable ?
any delta to the image will create a layer.
each instruction in the docker file will create a layer which cannot be modified which make an image immutable.

How we can build the docker container ?
How we can create a docker image ?
How to create the application image in docker ?

Why docker images are immutable ?
like strings in java ?
What is a docker image layering ?
How to Host an application in docker container using docker file ?
How to create your application image in docker ?
How to build a docker container using docker file ?
Docker file instruction set
FROM image - this specifies the base image that the build will extend.
WORKDIR path - this instruction specifies the "working directory" or the path in the image where files will be copied and commands will be executed.
COPY host-path image-path - this instruction tells the builder to copy files from the host and put them into the container image.
RUN command - this instruction tells the builder to run the specified command.
ENV name value - this instruction sets an environment variable that a running container will use.
EXPOSE port-number - this instruction sets configuration on the image that indicates a port the image would like to expose.
USER user-or-uid - this instruction sets the default user for all subsequent instructions.
CMD ["command", "arg1"] - this instruction sets the default command a container using this image will run.
How to create docker file in the project folder ?
Docker Init - Create 3 file.
Dockerfile.
Docker compose yaml
DockerIgnore
what is the command to build the docker image from docker file ?
Docker Build .
what is the command to build the docker image from docker file with the docker image name ?
Docker build --tag imagename.
Source Of Truth
==============================================
https://docs.docker.com/

Key Time Or Time Key Topic
==============================================
None

Unanswered Query or Concept from Last Sessions
==============================================
None

Regards,
Encyclopedia Book