Dockerfile and Instructions
Table of contents:
What is Dockerfile
In short:
- a Dockerfile is a text document that contains all instructions users provide to assemble an image
- each instruction will create a new image layer to the image
- instructiuons specify what to do when building the image
Example
Building docker image
To build docker image run:
Dockerfile build image output
Of course there is build output from cache. Docker image:
Context
What’s the context path:
- Docker build command takes the path on the build context as an argument
- when build starts, docker client would pack all the files in the build context into a tarball then transfer the tarball file to the daemon
- by default, dokcer would search for the Dockerfile in the build context path
Reference:
My site is free of ads and trackers. Was this post helpful to you? Why not
Disqus is great for comments/feedback but I had no idea it came with these gaudy ads.