×
☰ See All Chapters

Docker VOLUME command

The docker VOLUMEN command is used to create mount point in the image. This mount point can be used to mount volumes from the Docker host or form the other containers.

Docker VOLUME command syntax

The VOLUME command has two types of syntax, as shown below:

JSON Array Syntax

VOLUME ["<mountpoint1>", "<mountpoint2>", "<mountpoint2>",…]

Shell Syntax

VOLUME ["<mountpoint>"]

Docker EXPOSE command

Docker EXPOSE command is used to expose the post from container to communicate with the external world.

Docker EXPOSE command syntax

EXPOSE <portnum>[/<protocol>] [<portnum>[/<protocol>]...]

<portnum>: Port Number

<protocol>: Transport protocol, such as TCP and UDP. This is optional argument. If it is not specified, it defaults to TCP protocol.

 


All Chapters
Author