0% found this document useful (0 votes)
9 views9 pages

Docker Guide: Managing Volumes & Networks

Docker Guide
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views9 pages

Docker Guide: Managing Volumes & Networks

Docker Guide
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Propelling the Digital Transformation

DOCKER GUIDE
Part 3

(+1) 647-376-7753

support@[Link]
VOLUMES

Inspect details of a volume:


Terminal

> docker volume inspect volume_name


# Example
> docker volume inspect my_volume

Create a named volume:


Terminal

> docker volume create volume_name


# Example
> docker volume create my_volume
VOLUMES

List all volumes:


Terminal

> docker volume Is

Run a container with a volume (mount):


Terminal

> docker run --name container_name -v volume_name:/path/in/


container image_name:tag

# Example
> docker run --name my_container -v my_volume:/app/data
myapp:v1
VOLUMES

Remove a volume:
Terminal

> docker volume rm volume_name


# Example
> docker volume rm my_volum

Copy files between a container and a volume:


Terminal

> docker cp local_file_or_directory container_name:/path/in/


container
# Example
> docker cp [Link] my_container:/app/data
NETWORK

Inspect details of a network:


Terminal

> docker network inspect network_name


# Example
> docker network inspect bridge

Run a container with port mapping:


Terminal

> docker run --name container_name -p host_port:container_port


image_name

# Example
> docker run --name my_container -p 8080:80 myapp
NETWORK

List all networks:


Terminal

> docker network Is

Connect a container to a network:


Terminal

> docker network connect network_name container_name

# Example
> docker network connect my_network my_container
NETWORK

Create a user-defined bridge network:


Terminal

> docker network create network_name


# Example
> docker network create my_network

Disconnect a container from a network:


Terminal

> docker network disconnect network_name container_name

# Example
> docker network disconnect my_network my_container
NETWORK

View container logs:


Terminal

> docker logs container_name_or_id


# Example
> docker logs my_container

Inspect details of a container


Terminal

> docker inspect container_name_or_id


# Example
> docker inspect my_container
NETWORK

Terminal

Follow us for the next part!


👉🏻 [Link]
[Link]

👉🏻 [Link]
👉🏻[Link]

(+1) 647-376-7753

support@[Link]

You might also like