Docker
Docker
DOCKER
BASICS
ROHAN THAPA
[email protected]
What is a Docker?
Docker is a platform for developing, shipping,
and running applications inside containers.
2.LABEL
Adds metadata to an image in the form of key-value
pairs.
3.WORKDIR
Sets the working directory inside the container for
subsequent commands.
4.COPY
Copies files or directories from the host filesystem to
the container.
Common Dockerfile Instruction
5.ADD
Similar to COPY, but also supports extracting tar files
and downloading URLs.
6.RUN
Executes commands inside the container during the
build process.
7.CMD
Specifies the default command to run when a
container starts (overridden by docker run
command).
8.ENTRYPOINT
Configures the container to run as an executable
with a command that can't be overridden.
Common Dockerfile Instruction
9.ENV
Sets environment variables inside the container.
10.ARG
Defines build-time variables (accessible only during
the build process).
11.EXPOSE
Informs Docker that the container listens on specific
network ports.
12.VOLUME
Defines a mount point with a specific path in the
container to persist data.
Key Docker Concepts
Docker Hub
Docker Volumes
list images
Basic Docker Commands
search images
Docker Compose
Docker Compose is used to define and
manage multi-container applications. You
create a docker-compose.yml file, which
defines services, networks, and volumes.
Advanced Docker Concepts
Docker Swarm
Docker Swarm is Docker's native
clustering and orchestration tool. It allows
Docker hosts to group together into a
cluster, where containers can be scaled
and managed across multiple machines.
Kubernetes
Kubernetes is an open-source container
orchestration platform, which is often
used with Docker to automate the
deployment, scaling, and management of
containerized applications across clusters
of machines.
Advanced Docker Concepts
Docker in CI/CD