docker image详解

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值