Update image

pull/485/head
Kang Huaishuai 2021-03-11 23:09:37 +08:00
parent 7afb8991d3
commit bc43b30964
No known key found for this signature in database
GPG Key ID: 5E515022F565DA09
11 changed files with 19 additions and 19 deletions

View File

@ -40,7 +40,7 @@ FROM scratch
`scratch`
[`swarm`](https://hub.docker.com/_/swarm/)、[`etcd`](https://quay.io/repository/coreos/etcd)。对于 Linux 下静态编译的程序来说,并不需要有操作系统提供运行时支持,所需的一切库都已经在可执行文件里了,因此直接 `FROM scratch` 会让镜像体积更加小巧。使用 [Go 语言](https://golang.org/) 开发的应用很多会使用这种方式来制作镜像,这也是为什么有人认为 Go 是特别适合容器微服务架构的语言的原因之一。
Linux `FROM scratch` 使 [Go ](https://golang.google.cn/) 开发的应用很多会使用这种方式来制作镜像,这也是为什么有人认为 Go 是特别适合容器微服务架构的语言的原因之一。
## RUN

View File

@ -1,4 +1,4 @@
FROM golang:1.9-alpine as builder
FROM golang:alpine as builder
RUN apk --no-cache add git

View File

@ -1,4 +1,4 @@
FROM golang:1.9-alpine
FROM golang:alpine
RUN apk --no-cache add git

View File

@ -1,4 +1,4 @@
FROM golang:1.9-alpine
FROM golang:alpine
RUN apk --no-cache add git ca-certificates

View File

@ -6,7 +6,7 @@
`Dockerfile` `ARG` `docker build` `--build-arg <参数名>=<值>`
1.13 `--build-arg` `Dockerfile` `ARG` `--build-arg` `Dockerfile` 使使退 1.13 退使 CI `Dockerfile` Dockerfile
使 `ARG` Dockerfile
ARG `FROM` `FROM`

View File

@ -2,6 +2,6 @@
`EXPOSE <端口1> [<端口2>...]`
`EXPOSE` Dockerfile 使便使 `docker run -P` `EXPOSE`
`EXPOSE` Dockerfile 使便使 `docker run -P` `EXPOSE`
`EXPOSE` 使 `-p <宿主端口>:<容器端口>` `-p`宿访 `EXPOSE` 使宿

View File

@ -11,10 +11,10 @@
VOLUME /data
```
`/data` `/data`
`/data` `/data`
```bash
docker run -d -v mydata:/data xxxx
$ docker run -d -v mydata:/data xxxx
```
使 `mydata` `/data` `Dockerfile`

View File

@ -33,4 +33,4 @@ WORKDIR c
RUN pwd
```
`pwd` `/a/b/c`
`RUN pwd` `/a/b/c`

View File

@ -24,11 +24,11 @@ $ docker run -it --rm username/test
Docker
`Linux x86_64` `Linux arm64v8` `$ docker run golang:alpine go version`
`Linux x86_64` `Linux arm64v8` 使 `golang:alpine` `$ docker run golang:alpine go version`
`golang:alpine` [`manifest` ](https://docs.docker.com/registry/spec/manifest-v2-2/)。
`golang:alpine` [`manifest` (`manifest list`)](https://docs.docker.com/registry/spec/manifest-v2-2/)。
Docker `manifest` Docker Docker `golang:alpine` `username/test`
@ -122,7 +122,7 @@ $ docker manifest create username/test \
username/arm64v8-test
```
`manifest` `-a,--amend`
`manifest` `-a` `--amend`
## `manifest`

View File

@ -27,7 +27,7 @@ func main(){
`Dockerfile.one`
```docker
FROM golang:1.9-alpine
FROM golang:alpine
RUN apk --no-cache add git ca-certificates
@ -57,7 +57,7 @@ $ docker build -t go/helloworld:1 -f Dockerfile.one .
`Dockerfile.build`
```docker
FROM golang:1.9-alpine
FROM golang:alpine
RUN apk --no-cache add git
@ -126,7 +126,7 @@ go/helloworld 1 f55d3e16affc 2 minutes ago 295MB
`Dockerfile`
```docker
FROM golang:1.9-alpine as builder
FROM golang:alpine as builder
RUN apk --no-cache add git
@ -173,7 +173,7 @@ go/helloworld 1 f55d3e16affc 2 minutes ago 295MB
使 `as`
```docker
FROM golang:1.9-alpine as builder
FROM golang:alpine as builder
```
`builder` `--target=builder`

View File

@ -5,12 +5,12 @@
Docker `docker pull`
```bash
docker pull [] [Docker Registry [:]/][:]
$ docker pull [] [Docker Registry [:]/][:]
```
`docker pull --help`
* Docker `<域名/IP>[:端口号]` Docker Hub(docker.io)
* Docker `<域名/IP>[:端口号]` Docker Hub(`docker.io`)
* `<用户名>/<软件名>` Docker Hub `library`
@ -26,7 +26,7 @@ Status: Downloaded newer image for ubuntu:18.04
docker.io/library/ubuntu:18.04
```
Docker Docker Hub `ubuntu:18.04` `library/ubuntu` `18.04`
Docker Docker Hub `docker.io` `ubuntu:18.04` `library/ubuntu` `18.04` `docker pull` `docker.io/library/ubuntu:18.04`
ID 12 `sha256`