How to create a docker image?
-
`cd`
to a directory you like. -
Create a file
`Dockerfile`
or what you like. Say, it is a image about web, you can name it`web.dockerfile`
. -
A
`Dockerfile`
is a blueprint about a docker image. Now we need to config it, describing what we want the image to be. To learn more about how to config a`Dockerfile`
, you may want to see: -
Build the image with the finished
`Dockerfile`
by these commands:BASHdocker build .If you use the custom file name, like
`web.dockerfile`
:BASHdocker build -f web.dockerfile . -
If everything is fine, your image would be created. You may want to use these commands to check it:
BASHdocker image ls