DOCKER 镜像
是用来构建docker容器的,并且是只读的。通常一个容器构建于另一个容器基础之上。比如可以构建一个基于ubuntu的镜像,但是可以在它基础上安装apche web server和你自己的应用以及一些详细的配置,以便应用可以运行在该镜像上。
官方介绍:
An image is a read-only template with instructions for creating a Docker container. Often, an image is based on another image, with some additional customization. For example, you may build an image which is based on the ubuntu image, but installs the Apache web server and your application, as well as the configuration details needed to make your application run.
获取的方法:
1.从镜像仓库获取
docker hub/quay io 直接搜索官网地址即可。
2. 由dockerfile构建
官方介绍简单的语法:https://docs.docker.com/engine/reference/builder/
最主要包括FROM RUN CMD等等
有些official的image可以参考
https://github.com/docker-library/official-images/tree/master/library
这也是比较多使用的方法
3. 可以离线保存后使用
docker image save nginx -o nginx.image保存镜像
docker image load -i .\nginx.image load就可以使用该镜像了
4. 还可以从commit中创建
docker container commit [dockerid] name:version