Docker
###
- [ Docker ](#-docker-)
- [1.1 ](#11-)
- [1.2 ](#12-)
- [1.3 ](#13-)
- [1.4 PULL ](#14-pull-)
- [ Docker ](#-docker-)
- [2.1 images ](#21-images-)
- [2.2 tag ](#22--tag-)
- [2.3 inspect ](#23--inspect-)
- [2.4 history ](#24--history-)
- [ Docker ](#-docker-)
- [3.1 search ](#31-search-)
- [3.2 search ](#32-search-)
- [ Docker ](#-docker-)
- [4.1 ](#41-)
- [4.2 ID ](#42--id-)
- [4.3 ](#43-)
- [4.4 ](#44-)
- [ Docker ](#-docker-)
- [5.1 ](#51-)
- [5.2 Dockerfile ](#52--dockerfile-)
- [ Docker &](#-docker-)
- [6.1 ](#61-)
- [6.2 ](#62-)
- [ Docker ](#-docker-)
- [7.1 Docker ID](#71--docker-id)
- [7.2 ](#72-)
- [7.3 ](#73-)
- [ ](#-)
## Docker
Docker Docker Hub
### 1.1
`docker pull[IMAGE_NAME]:[TAG]` `IMAGE_NAME` `TAG` ** + **
**** TAG, latest latest bug, TAG
Mysql 5.7
```
docker pull mysql:5.7
```

**** DockerHub `docker.io` `docker.io`
**Downloaded**
### 1.2
Mysql5.7
```
docker images
```

### 1.3

`layer` `f7e2b70d04ae` ID ID 256 bit, 64
** layer,?**
Docker `layer`,Docker ID
**, **
`docker pull` ( `Registry`), Docker `docker.io` `pull` docker `docker.io/library`
`docker pull mysql:5.7` `docker pull docker.io/mysql:5.7` DockerHub
Docker
### 1.4 PULL
```
docker pull --help
```
```
[root@iZbp1j8y1bab0djl9gdp33Z ~]# docker pull --help
Usage: docker pull [OPTIONS] NAME[:TAG|@DIGEST]
Pull an image or a repository from a registry
Options: -a, --all-tags Download all tagged images in the repository --disable-content-trust Skip image verification (default true) --help Print usage
```
1. `-a,--all-tags=true|false`:
2. `--disable-content-trust`: true;
## Docker
### 2.1 images
```
docker images
```
```
docker image ls
```

- **REPOSITORY**:
- **TAG**: 5.7latest
- **IMAGE ID**: ID, ID
- **CREATED**:
- **SIZE**: alpine
> `layer`
### 2.2 tag
`docker tag`

`docker.io/mysql` `allen_mysql:5.7` `docker images`

`allen_mysql:5.7` `allen_mysql:5.7` `docker.io/mysql:5.7` ID
`docker tag` ,
### 2.3 inspect
`docker inspect`
```
docker inspect docker.io/mysql:5.7
```

`docker inspect` `JSON` `-f`
```
docker inspect -f {{".Size"}} docker.io/mysql:5.7
```

### 2.4 history
layer
`docker history` layer `docker.io/mysql:5.7`
```
docker history docker.io/mysql:5.7
```

`--no-trunc`
```
docker history --no-trunc docker.io/mysql:5.7
```
## Docker
### 3.1 search
```
docker search [option] keyword
```
`mysql`
```
docker search mysql
```

### 3.2 search
`docker search--help`,
```
Usage: docker search [OPTIONS] TERM
Search the Docker Hub for images
Options: -f, --filter filter Filter output based on conditions provided --help Print usage --limit int Max number of search results (default 25) --no-index Don't truncate output --no-trunc Don't truncate output
```
`search`
- `-f,--filter filter`:
- `--limitint`;
- `--no-index`:
- `--no-trunc`
mysql
```
docker search --filter=is-offical=true mysql
```

Stars 100 mysql
```
docker search --filter=stars=100 mysql
```

## Docker
### 4.1
```
docker rmi [image]
```
```
docker image rm [image]
```
- `-f,-force`:
- `-no-prune`:
Docker
`allen_mysql:5.7`
```shell
docker rmi allen_mysql:5.7
```

`allen_mysql:5.7` `docker.io/mysql:5.7` `allen_mysql:5.7`, `docker.io/mysql:5.7`
** `docker rmi` **
`docker images` `docker.io/mysql:5.7`

`docker.io/mysql:5.7`
`docker rmi docker.io/mysql:5.7`

`docker.io/mysql:5.7`
### 4.2 ID
ID,
```
docker rmi ee7cbd482336
```
ID
### 4.3
`docker pull alpine` `alpine` , `hello,docker!`:


`-f`
```
docker rmi -f docker.io/alpine
```
1.
2.
ID ( `9d59e2278553`),
```
docker rm 9d59e2278553
```
```
docker rmi 5cb3aa00f899
```
Docker
### 4.4
Docker
```
docker image prune
```
- `-a,--all`:
- `-f,--force`
## Docker
Docker Docker
1.
2. Dockerfile
3.
12
### 5.1
```
docker container commit
```
- `-a,--author`="":
- `-c,--change`=[]: Dockerfile CMDENTRYPOINTENVEXPOSELABELONBUILDUSERVOLUMEWORIR
- `-m,--message`="":
- `-p,--pause`=true:
Ubuntu

test.txt

```
docker run -it docker.io/ubuntu:latest /bin/bashroot@a0a0c8cfec3a:/# touch test.txtroot@a0a0c8cfec3a:/# exit
```
test.txt ID: `a0a0c8cfec3a`, (**PS: ID **)
```
docker container commit -m "Added test.txt file" -a "Allen" a0a0c8cfec3a test:0.1
```
ID

`test:0.1`

### 5.2 Dockerfile
Dockerfile Dockerfile
Dockerfile Ubuntu Python3
```
FROM docker.io/ubuntu:latest
LABEL version="1.0" maintainer="Allen "
RUN apt-get update && \ apt-get install -y python3 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/*
```
Dockerfile
```
docker image build -t python:3 .
```
****

python:3

## Docker &
Docker &
tar tar
1. `docker save`
2. `docker load`
### 6.1

python:3
```
docker save -o python_3.tar python:3
```
Docker
`python_3.tar`
### 6.2
`tar`
```
docker load -i python_3.tar
```
```
docker load < python_3.tar
```
## Docker
Docker Hub Docker
### 7.1 Docker ID
Docker Hub Docker Hub Docker Hub https://hub.docker.com

Docker ID ()Email,
Docker Hub

Docker Hub Docker ID

### 7.2


************

### 7.3
** Docker ID **
```
docker login
```
 Docker ID
`python:3`

** Docker ID **:
```
docker tag python:3 weiwosuoai1991/python:3
```

```
docker push weiwosuoai1991/python:3
```

Docker Hub

##
Docker ,,& Docker Hub