What does dot-colon .:
- .:/var/www/project:cached
mean in situation like this:
version: '3'
services:
php:
image: php:7.1-fpm
ports:
- 9000
volumes:
- .:/var/www/project:cached
Is this part of bash syntax or is it part of Docker syntax (haven't found any info on both).
The dot-dot — the colonPut a colon before your explanation. Lucy told me yesterday she has three nanas: Nana Trina; Nana (Josie); and Nana Coll, who's actually Lucy's great aunt. I've come along with four of my workmates: Jayne, Lynda, Reece, and Inez.
Colons introduce or define something. The primary use of semicolons is to join two main clauses. The difference between semicolons and colons is that colons can combine two independent clauses, but their primary use is to join independent clauses with a list or a noun.
The colon ( : ) is a mark of punctuation used after a statement (such as an independent clause) or that introduces a quotation, an explanation, an example, or a series.
A colon is a punctuation mark consisting of two dots, one placed above the other. It looks like this : Colons are often used to introduce a list, but that's not all they can do! Think of a colon as a flashing sign that points to your text.
.
is used for "current directory":
is used to separate the host
's path from container
's path. (Each volume uses a source
path for the host and a destination
path for the container).:cached
seems to be a caching option for docker-for-mac
From the docs:
Short syntax
Optionally specify a path on the host machine (
HOST:CONTAINER
), or an access mode (HOST:CONTAINER:ro
).You can mount a relative path on the host, that expands relative to the directory of the Compose configuration file being used. Relative paths should always begin with
.
or..
.
As per documentation:
Optionally specify a path on the host machine (
HOST:CONTAINER
), or an access mode (HOST:CONTAINER:ro
).You can mount a relative path on the host, that expands relative to the directory of the Compose configuration file being used. Relative paths should always begin with
.
or..
.
The .
is a directory where docker-compose file is located. It will be mounted to the path after the colon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With