이 포스트는 udemy: Docker Mastery: with Kubernetes +Swarm from a Docker Captain를 배우며 쓰는 글입니다
Official Definition
An image is an ordered collection of root filesystem changes and the corresponding execution parameters for use within a container runtime
**Package Manager**
PM's like apt and yum are one of the reasons to build containers FROM Debian, Ubuntu, Fedora or CentOS
**Environment Variable**
One reason they were chosen as preferred way to inject key/value is they work everywhere, on every OS and config
Example1
Velog가 DockerFile 코드블럭은 따로 서포트를 안하니 스크린샷으로...
Upon building an image based on a dockerfile,
Docker will go through each line adding layers and caching them so that if we try to use the same layer, it won't repeat it! 🪄
Example2
이 dockerfile은 기존에 있던 nginx에서 html을 바꿔주며 build 과정을 실행합니다. 결과적으로,
에서 아래 텍스트로 성공적으로 바뀐걸 볼수 있습니다.
docker pull
get the lastest version of the iamge
but it is always better to specify the version.
**docker image +**
history
show layeres of changes made in image
inspect
return JSON metadata about the image
tag
assign one or more tags to an image.
push
push repo
build <image> .
build an image from dockerfile from (dot) current directory.
prune
clean up just "dangling" images, -a
remove all images not being used.
-f
specify dockerfile to build
--latest
This tag is not actually latest, but it's just the default.(Docker standard)
Format: <user>/<repo>:<tag>
List of Docker Official Images can be found in https://github.com/docker-library/official-images/tree/master/library