Problem Solving

Why a dot(.) is used at the end of docker build command?

REAL IT 2023. 11. 16. 20:02
728x90

 

Becasue it means a context.

 

When you build an image by typing

 

'docker build .'

 

or like

 

'docker -t some_tag -f some_dockerfile .'

 

you are using the dot(.) at the end of it.

 

The dot argument is for giving docker a context(PATH/ URL).

 

By using the context, you can do things like copy your files into the image.