Docker Image
Creation
The following are the steps to create an image.
Create a file named
Dockerfile
Add the dependencies
Add the default command to be executed on container started from this image.
A sample Docker file contents is shown below,
# Sample Dockerfile
# Specify a base image from which an existing docker image will be created
FROM alpine:latest
# Download and install a dependency/dependencies
RUN apk add --update redis
# Specify the default command to be executed
CMD ["redis-server"]
Running the above docker file results in following output

Image Creation Flow

Container images are composed of layers and understanding this process helps is key to understanding image, read more about it here.
Reference
More reference to different docker file instructions can be found here.
Last updated