docker_practice/repository/dockerhub.md

96 lines
4.4 KiB
Go
Raw Normal View History

# Docker Hub
2017-11-24 22:42:49 +08:00
Docker [Docker Hub](https://hub.docker.com/),其中已经包括了数量超过 [2,650,000](https://hub.docker.com/search/?type=image) 的镜像。大部分需求都可以通过在 Docker Hub 中直接下载镜像来实现。
2017-11-24 22:42:49 +08:00
##
2017-11-24 22:42:49 +08:00
2018-12-14 19:36:17 +08:00
https://hub.docker.com 免费注册一个 Docker 账号。
2017-11-24 22:42:49 +08:00
##
2014-09-17 20:18:51 +08:00
2017-11-24 22:42:49 +08:00
`docker login` Docker Hub
`docker logout` 退
##
2017-11-24 22:42:49 +08:00
`docker search` `docker pull`
2014-09-17 20:18:51 +08:00
2017-11-24 22:42:49 +08:00
`centos`
2017-11-13 18:54:38 +08:00
```bash
$ docker search centos
2014-09-26 17:45:51 +08:00
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
centos The official build of CentOS. 465 [OK]
tianon/centos CentOS 5 and 6, created using rinse instea... 28
blalor/centos Bare-bones base CentOS 6.5 image 6 [OK]
saltstack/centos-6-minimal 6 [OK]
tutum/centos-6.4 DEPRECATED. Use tutum/centos:6.4 instead. ... 5 [OK]
2014-09-17 20:18:51 +08:00
```
2017-11-24 22:42:49 +08:00
2019-03-08 12:21:07 +08:00
OFFICIAL AUTOMATED
2017-11-24 22:42:49 +08:00
2019-03-08 12:21:07 +08:00
2014-09-26 17:45:51 +08:00
2017-11-24 22:42:49 +08:00
`centos` Docker 使
2019-03-08 12:21:07 +08:00
`tianon/centos` Docker Hub `username/` 使 tianon
2017-11-24 22:42:49 +08:00
`--filter=stars=N` `N`
`centos`
2014-09-26 17:45:51 +08:00
2017-11-13 18:54:38 +08:00
```bash
$ docker pull centos
2014-09-17 20:18:51 +08:00
Pulling repository centos
0b443ba03958: Download complete
539c0211cd76: Download complete
511136ea3c5a: Download complete
7064731afe90: Download complete
```
2017-11-24 22:42:49 +08:00
##
2017-11-24 22:42:49 +08:00
`docker push` Docker Hub
`username` Docker
```bash
$ docker tag ubuntu:18.04 username/ubuntu:18.04
2017-11-24 22:42:49 +08:00
2017-12-05 11:15:24 +08:00
$ docker image ls
2017-11-24 22:42:49 +08:00
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu 18.04 275d79972a86 6 days ago 94.6MB
username/ubuntu 18.04 275d79972a86 6 days ago 94.6MB
2017-11-24 22:42:49 +08:00
$ docker push username/ubuntu:18.04
2017-11-24 22:42:49 +08:00
$ docker search username
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
username/ubuntu
```
2014-09-17 20:18:51 +08:00
##
2017-11-24 22:42:49 +08:00
2019-03-08 12:21:07 +08:00
Automated Builds便
2014-09-17 20:18:51 +08:00
2019-03-08 12:21:07 +08:00
2017-11-24 22:42:49 +08:00
2019-03-08 12:21:07 +08:00
Docker Hub [GitHub](https://github.com) 或 [BitBucket](https://bitbucket.org))上的项目,一旦项目发生新的提交 commit或者创建了新的标签tagDocker Hub 会自动构建镜像并推送到 Docker Hub 中。
2014-09-17 20:18:51 +08:00
2019-03-08 12:21:07 +08:00
2017-11-24 22:42:49 +08:00
2019-03-08 12:21:07 +08:00
* Docker Hub
2017-11-24 22:42:49 +08:00
2019-03-08 12:21:07 +08:00
* Docker Hub Account SettingsLinked Accounts
2017-11-24 22:42:49 +08:00
2019-03-08 12:21:07 +08:00
* Docker Hub `Builds` `Configure Automated Builds`
2014-09-17 20:18:51 +08:00
2017-11-24 22:42:49 +08:00
* `Dockerfile`
2019-03-08 12:21:07 +08:00
* `Dockerfile`
2017-11-24 22:42:49 +08:00
2019-03-08 12:21:07 +08:00
Docker Hub `Timeline`