博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
docker-hub OFFICIAL & AUTOMATED images
阅读量:7256 次
发布时间:2019-06-29

本文共 8580 字,大约阅读时间需要 28 分钟。

在使用docker search从docker hub 查询images时, 返回的数据包含name, 描述, stars, official, automated的信息.
如 : 
[root@db-172-16-3-221 ~]# docker search postgresNAME                                         DESCRIPTION                                     STARS     OFFICIAL   AUTOMATEDpostgres                                     The PostgreSQL object-relational database ...   273       [OK]       paintedfox/postgresql                        A docker image for running Postgresql.          45                   [OK]helmi03/docker-postgis                       PostGIS 2.1 in PostgreSQL 9.3                   19                   [OK]
....

stars类似github里面的star, 或者点赞的意思. 代表流行率.
OFFICIAL   和 AUTOMATED
The Official and Automated build statuses. Official repositories are built and maintained by the Stackbrew project, and Automated repositories are Automated Builds that allow you to validate the source and content of an image.
Docker Official Images指docker标准库, 由docker 官方建立. 用户建立的image则会有userid的prefix. 
We've reviewed the images available to use and we decided to use the training/sinatra image. So far we've seen two types of images repositories, images like ubuntu, which are called base or root images. These base images are provided by Docker Inc and are built, validated and supported. These can be identified by their single word names.We've also seen user images, for example the training/sinatra image we've chosen. A user image belongs to a member of the Docker community and is built and maintained by them. You can identify user images as they are always prefixed with the user name, here training, of the user that created them
automated builds 则是通过代码版本管理网站结合docker hub提供的接口生成的, 例如github, bitbucket, 
你需要注册docker hub, 然后使用github或bitbucket的在账户链接到docker hub, 然后就可以选择在github或bitbucket里面的项目自动build docker image, 这样的话只要代码版本管理网站的项目有更新, 就会触发自动创建image.

Automated Builds

Automated Builds automate the building and updating of images from GitHub or BitBucket, directly on Docker Hub. It works by adding a commit hook to your selected GitHub or BitBucket repository, triggering a build and update when you push a commit.To setup an Automated BuildCreate a Docker Hub account and login.Link your GitHub or BitBucket account through the "Link Accounts" menu.Configure an Automated Build.Pick a GitHub or BitBucket project that has a Dockerfile that you want to build.Pick the branch you want to build (the default is the master branch).Give the Automated Build a name.Assign an optional Docker tag to the Build.Specify where the Dockerfile is located. The default is /.Once the Automated Build is configured it will automatically trigger a build and, in a few minutes, you should see your new Automated Build on the Docker Hub Registry. It will stay in sync with your GitHub and BitBucket repository until you deactivate the Automated Build.If you want to see the status of your Automated Builds, you can go to your Automated Builds page on the Docker Hub, and it will show you the status of your builds and their build history.Once you've created an Automated Build you can deactivate or delete it. You cannot, however, push to an Automated Build with the docker push command. You can only manage it by committing code to your GitHub or BitBucket repository.You can create multiple Automated Builds per repository and configure them to point to specificDockerfile's or Git branches.Build TriggersAutomated Builds can also be triggered via a URL on Docker Hub. This allows you to rebuild an Automated build image on demand.
例如从docker hub pull一个官方image.
[root@db-172-16-3-221 lib]# docker pull postgres
下载结束之后, 可以查看到所有的TAG都pull下来了
[root@db-172-16-3-221 lib]# docker imagesREPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZEpostgres            9.4-beta3           68b6ddf9ca08        42 hours ago        213.6 MBpostgres            9.4                 68b6ddf9ca08        42 hours ago        213.6 MBpostgres            9.3                 935836384c52        42 hours ago        212.9 MBpostgres            9                   935836384c52        42 hours ago        212.9 MBpostgres            9.3.5               935836384c52        42 hours ago        212.9 MBpostgres            latest              935836384c52        42 hours ago        212.9 MBpostgres            9.2                 2a9ab0b9fa56        42 hours ago        212.7 MBpostgres            9.2.9               2a9ab0b9fa56        42 hours ago        212.7 MBpostgres            9.1.14              ee60947f6805        42 hours ago        212.1 MBpostgres            9.1                 ee60947f6805        42 hours ago        212.1 MBpostgres            9.0.18              f29be88283f6        42 hours ago        211.5 MBpostgres            9.0                 f29be88283f6        42 hours ago        211.5 MBpostgres            8                   c57c14beb696        42 hours ago        211 MBpostgres            8.4                 c57c14beb696        42 hours ago        211 MBpostgres            8.4.22              c57c14beb696        42 hours ago        211 MBpostgres            9.4-beta2           bf872395e1d4        2 weeks ago         213.6 MB
使用inspect查看image的内容
[root@db-172-16-3-221 lib]# docker inspect postgres:9.3.5[{    "Architecture": "amd64",    "Author": "",    "Comment": "",    "Config": {        "AttachStderr": false,        "AttachStdin": false,        "AttachStdout": false,        "Cmd": [            "postgres"        ],        "CpuShares": 0,        "Cpuset": "",        "Domainname": "",        "Entrypoint": [            "/docker-entrypoint.sh"        ],        "Env": [            "PATH=/usr/lib/postgresql/9.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",            "LANG=en_US.utf8",            "PG_MAJOR=9.3",            "PG_VERSION=9.3.5-1.pgdg70+1",            "PGDATA=/var/lib/postgresql/data"        ],        "ExposedPorts": {            "5432/tcp": {}        },        "Hostname": "39d2c877bc4f",        "Image": "15d042248df39ca896223c9e75f0f4541996f2b52030f1f8e6619cf18f77e395",        "Memory": 0,        "MemorySwap": 0,        "NetworkDisabled": false,        "OnBuild": [],        "OpenStdin": false,        "PortSpecs": null,        "StdinOnce": false,        "Tty": false,        "User": "",        "Volumes": {            "/var/lib/postgresql/data": {}        },        "WorkingDir": ""    },    "Container": "977043cde52cd15e070d71a67fbd8e2ec908af49123f3f773f71cda2061e9f44",    "ContainerConfig": {        "AttachStderr": false,        "AttachStdin": false,        "AttachStdout": false,        "Cmd": [            "/bin/sh",            "-c",            "#(nop) CMD [postgres]"        ],        "CpuShares": 0,        "Cpuset": "",        "Domainname": "",        "Entrypoint": [            "/docker-entrypoint.sh"        ],        "Env": [            "PATH=/usr/lib/postgresql/9.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",            "LANG=en_US.utf8",            "PG_MAJOR=9.3",            "PG_VERSION=9.3.5-1.pgdg70+1",            "PGDATA=/var/lib/postgresql/data"        ],        "ExposedPorts": {            "5432/tcp": {}        },        "Hostname": "39d2c877bc4f",        "Image": "15d042248df39ca896223c9e75f0f4541996f2b52030f1f8e6619cf18f77e395",        "Memory": 0,        "MemorySwap": 0,        "NetworkDisabled": false,        "OnBuild": [],        "OpenStdin": false,        "PortSpecs": null,        "StdinOnce": false,        "Tty": false,        "User": "",        "Volumes": {            "/var/lib/postgresql/data": {}        },        "WorkingDir": ""    },    "Created": "2014-10-21T05:54:39.659381225Z",    "DockerVersion": "1.2.0",    "Id": "935836384c524aafc0ac1c05246002c9c93343f0b4283a34e77a5f92f97f9a7c",    "Os": "linux",    "Parent": "15d042248df39ca896223c9e75f0f4541996f2b52030f1f8e6619cf18f77e395",    "Size": 0}
docker下载的image会放到/var/lib/docker目录中(默认如此, 如果启动docker时使用-g指定其他目录的话, 那么会放到其他目录)
[root@db-172-16-3-221 docker]# lltotal 44drwx------   2 root root  4096 Oct 22 10:59 containersdrwx------   5 root root  4096 Oct 22 11:00 devicemapperdrwx------   3 root root  4096 Oct 22 10:59 execdriverdrwx------ 102 root root 12288 Oct 23 07:42 graphdrwx------   2 root root  4096 Oct 22 10:59 init-rw-r--r--   1 root root  5120 Oct 22 10:59 linkgraph.db-rw-------   1 root root  1223 Oct 23 07:42 repositories-devicemapperdrwx------   2 root root  4096 Oct 22 10:59 volumes
所以docker主机最好使用额外的分区或存储来加载/var目录.(例如zfs, lv)
或者在第一次启动docker服务前先建好docker, 使用软链接练过去.
mkdir /data01/dockerln -s /data01/docker /var/lib/
那么在启动docker服务后, 就会使用这个目录了.
service docker start
[参考]
1. 
2. 

转载地址:http://tytdm.baihongyu.com/

你可能感兴趣的文章
POJ1201 Intervals
查看>>
使用git提交本地代码到github
查看>>
从零开始学习ios(UIImageView)控件及其属性
查看>>
MySQL rename database如何做?
查看>>
mysql的线程处于System lock状态下
查看>>
ACTION_CANCEL事件和事件回传
查看>>
java数据库查询类
查看>>
"河北科技创新平台年报系统"课堂讨论
查看>>
这半年的一些事情
查看>>
[30期] 我对人生道路的总结
查看>>
基于ARM处理器的反汇编器软件简单设计及实现
查看>>
巨杉数据库助力民生银行、恒丰银行云化架构升级
查看>>
超好用的VueJs调试工具——vue-devtools
查看>>
对象键
查看>>
[LeetCode] Unique Binary Search Trees, Solution
查看>>
[AtCoder2558]Many Moves
查看>>
【数据库_Mysql】JAVA-数据库Date格式在前台JSP页面的获取
查看>>
程序员的职业发展 (转)
查看>>
mysql中Time Date DateTime TimeStaamp区别
查看>>
STM32是如何进入中断服务函数xxx_IRQHandler的
查看>>