This commit is contained in:
2021-11-14 15:52:46 +08:00
parent 915c231124
commit 1e344dc204
112 changed files with 1039 additions and 1039 deletions

View File

@@ -6,8 +6,8 @@ tags: ["docker"]
categories: ["container"]
---
# 安装 docker
## CentOS7 安装 docker-ce
## 安装 docker
### CentOS7 安装 docker-ce
- 配置 yum 源
```bash
curl -Lo /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/centos/docker-ce.repo
@@ -40,7 +40,7 @@ categories: ["container"]
systemctl start docker
```
## 常用的 linux with systemd 安装 docker
### 常用的 linux with systemd 安装 docker
- 下载 docker 二进制文件
```bsah
curl -LO https://download.docker.com/linux/static/stable/x86_64/docker-20.10.10.tgz
@@ -193,7 +193,7 @@ categories: ["container"]
systemctl start docker
```
# 安装 docker-compose
## 安装 docker-compose
- 下载 docker-compose
```bash
curl -LO https://github.com/docker/compose/releases/download/v2.1.0/docker-compose-linux-x86_64
@@ -205,7 +205,7 @@ categories: ["container"]
chmod 0755 /usr/bin/docker-compose
```
# 安装 gojq
## 安装 gojq
- 该工具支持平台较多,无依赖,与 jq 命令操作完全一致,可用于替换 jq 命令
- 下载
```bash
@@ -220,7 +220,7 @@ categories: ["container"]
rm -rf gojq_*
```
# 基本命令
## 基本命令
- 镜像
```bash
docker pull [选项] [Docker Registry地址]<仓库名>:<标签> #获取镜像
@@ -280,7 +280,7 @@ categories: ["container"]
docker run [选项] --link <待链接容器名>:<链接别名> [地址]<仓库名>:<标签> [命令] #创建一个链接到其他容器的新容器
```
# Dockerfile
## Dockerfile
- 井号 "#" 后是注释
- FROM 基础镜像
- MAINTAINER 维护者信息
@@ -294,8 +294,8 @@ categories: ["container"]
- EXPOSE 向外部开放端口
- CMD 容器启动后运行的程序
# docker 镜像仓库
## 官方 registry
## docker 镜像仓库
### 官方 registry
- 直接 docker 启动
```bash
docker run -d \
@@ -306,7 +306,7 @@ categories: ["container"]
registry
```
## VMWare Harbor
### VMWare Harbor
- 安装[参考这里](https://goharbor.io/docs/2.0.0/install-config/)
- docker registry 采用 http 协议,客户端提示 “server gave HTTP response to HTTPS client”
```bash