From d22cf25178440b0da5d709ccd0c255633643be65 Mon Sep 17 00:00:00 2001 From: jaywcjlove Date: Fri, 30 Sep 2022 09:33:55 +0000 Subject: [PATCH] feat: add `dockerfile.md` cheatsheet. 7487fbf680640a568b8c02879dfcf5de264c84a6 --- docs/cron.html | 7 +- docs/docker.html | 11 ++- docs/dockerfile.html | 150 +++++++++++++++++++++++++++++++++++++ docs/emoji.html | 7 +- docs/find.html | 7 +- docs/git.html | 7 +- docs/html-char.html | 7 +- docs/http-status-code.html | 7 +- docs/javascript.html | 7 +- docs/jest.html | 7 +- docs/json.html | 7 +- docs/markdown.html | 7 +- docs/npm.html | 7 +- docs/package.json.html | 7 +- docs/quickreference.html | 9 ++- docs/sed.html | 7 +- docs/semver.html | 7 +- docs/sketch.html | 7 +- docs/toml.html | 7 +- docs/typescript.html | 7 +- docs/vscode.html | 7 +- docs/xpath.html | 7 +- index.html | 48 +++++++----- style/style.css | 10 ++- 24 files changed, 315 insertions(+), 46 deletions(-) create mode 100644 docs/dockerfile.html diff --git a/docs/cron.html b/docs/cron.html index 131e62a4..8a856883 100644 --- a/docs/cron.html +++ b/docs/cron.html @@ -9,7 +9,12 @@ -

Cron 备忘清单

+

Cron 备忘清单

Cron 最适合安排重复性任务。 可以使用关联的 at 实用程序来完成一次性任务的调度。

Crontab 格式

格式

diff --git a/docs/docker.html b/docs/docker.html index 1fa7e70d..23089c54 100644 --- a/docs/docker.html +++ b/docs/docker.html @@ -9,7 +9,12 @@ -

Docker 备忘清单

+

Docker 备忘清单

这是 Docker 的快速参考备忘单。 你可以在这里找到最常见的 Docker 命令。

入门

入门

@@ -209,7 +214,7 @@

更新容器

docker update --cpu-shares 512 -m 300M nginx-server
 
-

Docker Images

+

Docker 镜像

操控

@@ -266,7 +271,7 @@ $ docker build -f myOtherDockerfile . $ curl example.com/remote/Dockerfile | docker build -f - . -

Docker 联网

+

Docker 网络

操作

删除网络

docker network rm MyOverlayNetwork
diff --git a/docs/dockerfile.html b/docs/dockerfile.html
new file mode 100644
index 00000000..3c144bd1
--- /dev/null
+++ b/docs/dockerfile.html
@@ -0,0 +1,150 @@
+
+
+
+
+Dockerfile 备忘清单
+ &  dockerfile cheatsheet &  Quick Reference
+
+
+
+
+
+

Dockerfile 备忘清单

+

这是 Dockerfile 的快速参考备忘单。包含用户可以在命令行上调用以组装镜像的所有命令。

+

参考

+

继承

+

默认 Dockerfile 位于上下文的根目录中。

+ +
docker build -f /path/to/a/Dockerfile .
+
+

使用 -f 指向文件系统中任何位置的 Dockerfile

+

继承

+
FROM [--platform=<platform>] <image> [AS <name>]
+
+

示例

+
FROM ruby:2.2.2
+FROM golang:1.19-alpine3.16 AS build-env
+
+

变量

+
ENV <key>=<value> ...
+
+
ENV APP_HOME /myapp
+RUN mkdir $APP_HOME
+
+
ENV MY_NAME="John Doe" MY_DOG=Rex\ The\ Dog \
+    MY_CAT=fluffy
+
+

初始化

+
RUN bundle install
+
+
WORKDIR /myapp
+
+
VOLUME ["/data"]
+# 安装点规范
+
+
ADD file.xyz /file.xyz
+COPY --chown=user:group host_file.xyz /path/container_file.xyz
+
+

Onbuild

+
ONBUILD RUN bundle install
+# 与另一个文件一起使用时
+
+

命令

+
EXPOSE 5900
+CMD ["bundle", "exec", "rails", "server"]
+
+

在严格的 shell 中运行命令

+
ENV my_var
+SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
+# With strict mode:
+RUN false         # ails 像使用 && 一样构建
+RUN echo "$myvar" # 由于拼写错误会抛出错误
+RUN true | false  # 将脱离管道
+
+

使用 shell 将为 shell 命令打开严格模式。

+

入口点

+
ENTRYPOINT ["executable", "param1", "param2"]
+ENTRYPOINT command param1 param2
+
+

配置将作为可执行文件运行的容器。

+
ENTRYPOINT exec top -b
+
+

这将使用 shell 处理来替换 shell 变量,并将忽略任何 CMDdocker run 命令行参数。

+

元数据

+
LABEL version="1.0"
+
+
LABEL "com.example.vendor"="ACME Incorporated"
+LABEL com.example.label-with-value="foo"
+LABEL version="1.0"
+
+
LABEL description="本文说明\
+标签值可以跨越多行。"
+LABEL multi.label1="value1" \
+      multi.label2="value2" \
+      other="value3"
+
+

主要命令

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
命令说明
FROM image构建的基础镜像
MAINTAINER email(已弃用)维护者的名字
COPY [--chown=<user>:<group>] <src>... <dest>将上下文中的路径复制到位置 dest 的容器中
ADD [--chown=<user>:<group>] <src>... <dest>COPY 相同,但解压缩存档并接受 http url。
RUN <command>在容器内运行任意命令。
USER <user>[:<group>]设置默认用户名。
WORKDIR /path/to/workdir设置默认工作目录。
CMD command param1 param2设置默认命令
ENV <key>=<value> ...设置环境变量
EXPOSE <port> [<port>/<protocol>...]运行时侦听指定的网络端口
+

也可以看看

+ + +
© 2022 Kenny Wang, All rights reserved.
+ diff --git a/docs/emoji.html b/docs/emoji.html index e85d724b..2d2acf12 100644 --- a/docs/emoji.html +++ b/docs/emoji.html @@ -9,7 +9,12 @@ -

Emoji 备忘清单

+

Emoji 备忘清单

有些表情符号代码不太容易记住,所以这里有一个小备忘单。

入门

People

diff --git a/docs/find.html b/docs/find.html index e6a501cd..f07497a5 100644 --- a/docs/find.html +++ b/docs/find.html @@ -9,7 +9,12 @@ -

Find 备忘清单

+

Find 备忘清单

这是 Linux find 命令备忘单的快速参考列表,包含常用选项和示例。

入门

用法

diff --git a/docs/git.html b/docs/git.html index 57037910..47a14e9a 100644 --- a/docs/git.html +++ b/docs/git.html @@ -9,7 +9,12 @@ -

Git 备忘清单

+

Git 备忘清单

本备忘单总结了常用的 Git 命令行指令,以供快速参考。

入门

创建存储库

diff --git a/docs/html-char.html b/docs/html-char.html index 7982a1a0..fd579570 100644 --- a/docs/html-char.html +++ b/docs/html-char.html @@ -9,7 +9,12 @@ -

HTML 字符实体备忘清单

+

HTML 字符实体备忘清单

此备忘清单是 HTML 实体及其编号和名称的完整列表。还包括可以用 HTML 表示的 ASCII 字符的完整列表。

HTML 字符实体引用

HTML 特殊字符

diff --git a/docs/http-status-code.html b/docs/http-status-code.html index 45cfc40a..f295f124 100644 --- a/docs/http-status-code.html +++ b/docs/http-status-code.html @@ -9,7 +9,12 @@ -

HTTP 状态码备忘清单

+

HTTP 状态码备忘清单

HTTP 状态码备忘清单。 每个 HTTP 状态代码的快速参考。

HTTP 状态码

Means

diff --git a/docs/javascript.html b/docs/javascript.html index d321f6af..02d4cdaa 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -9,7 +9,12 @@ -

JavaScript 备忘清单

+

JavaScript 备忘清单

包含最重要概念、函数、方法等的 JavaScript 备忘单。 初学者的完整快速参考。

入门

介绍

diff --git a/docs/jest.html b/docs/jest.html index 807d6e96..8732956e 100644 --- a/docs/jest.html +++ b/docs/jest.html @@ -9,7 +9,12 @@ -

Jest 备忘清单

+

Jest 备忘清单

Jest 是一款优雅、简洁的 JavaScript 测试框架。

入门

介绍

diff --git a/docs/json.html b/docs/json.html index 2db89d75..f56efb4e 100644 --- a/docs/json.html +++ b/docs/json.html @@ -9,7 +9,12 @@ -

JSON 备忘清单

+

JSON 备忘清单

这是理解和编写 JSON 格式配置文件的快速参考备忘单。

入门

介绍

diff --git a/docs/markdown.html b/docs/markdown.html index b4caa63c..18d96b04 100644 --- a/docs/markdown.html +++ b/docs/markdown.html @@ -9,7 +9,12 @@ -

Markdown 备忘清单

+

Markdown 备忘清单

这是 Markdown 语法的快速参考备忘单。

Markdown 快速参考

标题 (atx 风格)

diff --git a/docs/npm.html b/docs/npm.html index a3901728..2dbad530 100644 --- a/docs/npm.html +++ b/docs/npm.html @@ -9,7 +9,12 @@ -

npm 备忘清单

+

npm 备忘清单

这个 npm 快速参考备忘单显示了它的常用命令使用清单。

常用命令

包管理

diff --git a/docs/package.json.html b/docs/package.json.html index 3a4595fc..d97032b3 100644 --- a/docs/package.json.html +++ b/docs/package.json.html @@ -9,7 +9,12 @@ -

package.json 备忘清单

+

package.json 备忘清单

这个快速参考备忘清单,显示了关于 package.json 文件中所需内容的全部内容。

重要字段

介绍

diff --git a/docs/quickreference.html b/docs/quickreference.html index aea5b610..27813a8b 100644 --- a/docs/quickreference.html +++ b/docs/quickreference.html @@ -9,7 +9,12 @@ -

Quick Reference 备忘清单

+

Quick Reference 备忘清单

这是您可以在 Quick Reference 备忘单上使用的样式参考,快速参与贡献!

入门

本地编译预览

@@ -104,7 +109,7 @@

注释配置添加 show-header 类,放置在表格下面,表头将被展示出来。

Tooltips

鼠标移动到上面有提示Tooltips 的提示内容

-

添加注释配置 <!--rehype:tooltips--> 添加一个 tooltips 提示。

+

添加注释配置 <!--rehype:tooltips--> 添加一个 Tooltips 提示。

H3 部分(卡片)背景颜色

### H3 部分(卡片)背景颜色
 <!--rehype:wrap-style=background: #00c69357;-->
diff --git a/docs/sed.html b/docs/sed.html
index 041db766..48595bc9 100644
--- a/docs/sed.html
+++ b/docs/sed.html
@@ -9,7 +9,12 @@
 
 
 
-

Sed 备忘清单

+

Sed 备忘清单

入门

Sed 用法

语法

diff --git a/docs/semver.html b/docs/semver.html index 31f1388e..2cc29bbe 100644 --- a/docs/semver.html +++ b/docs/semver.html @@ -9,7 +9,12 @@ -

Semver 备忘清单

+

Semver 备忘清单

这个 semver 语义化版本快速参考备忘清单。

语义化版本标准

介绍

diff --git a/docs/sketch.html b/docs/sketch.html index 34fe29dd..b01445ec 100644 --- a/docs/sketch.html +++ b/docs/sketch.html @@ -9,7 +9,12 @@ -

Sketch 备忘清单

+

Sketch 备忘清单

这个 Sketch 快速参考备忘单显示了它的键盘快捷键和命令。

快捷键

插入

diff --git a/docs/toml.html b/docs/toml.html index d4d205b1..e060344c 100644 --- a/docs/toml.html +++ b/docs/toml.html @@ -9,7 +9,12 @@ -

TOML 备忘清单

+

TOML 备忘清单

这是 TOML 格式配置文件语法的快速参考备忘清单。

入门

介绍

diff --git a/docs/typescript.html b/docs/typescript.html index 4b0b8b95..b278fe40 100644 --- a/docs/typescript.html +++ b/docs/typescript.html @@ -9,7 +9,12 @@ -

TypeScript 备忘清单

+

TypeScript 备忘清单

包含最重要基础、泛型、方法、class 等 TypeScript 强类型编程语言语法的快速参考备忘单。初学者的完整快速参考。

入门 Interface

介绍

diff --git a/docs/vscode.html b/docs/vscode.html index bc549631..8ae7a0cf 100644 --- a/docs/vscode.html +++ b/docs/vscode.html @@ -9,7 +9,12 @@ -

VSCode 备忘清单

+

VSCode 备忘清单

这个 VSCode (Visual Studio Code) 快速参考备忘单显示了它的键盘快捷键和命令。

Windows

一般的

diff --git a/docs/xpath.html b/docs/xpath.html index 7bed93f4..c1c31497 100644 --- a/docs/xpath.html +++ b/docs/xpath.html @@ -9,7 +9,12 @@ -

XPath 备忘清单

+

XPath 备忘清单

这是一份 XPath 选择器备忘单,其中列出了常用的 XPath 定位方法和 CSS 选择器

XPath 选择器

入门

diff --git a/index.html b/index.html index 3fd9410d..35d1122c 100644 --- a/index.html +++ b/index.html @@ -5,25 +5,28 @@ Quick Reference & Quick Reference - + -

Quick Reference

-

为开发人员分享快速参考备忘单(主要是方便自己),在看到 Reference 快速参考备忘单,感觉非常简单,造轮子使命感突然来了,造个中文版本的,为了方便自己的技术栈查阅,立马撸起来 :)。

+

Quick Reference

+

为开发人员分享快速参考备忘清单(主要是方便自己),在看到 Reference 快速参考备忘单,感觉非常简单,造轮子使命感突然来了,造个中文版本的,为了方便自己的技术栈查阅,立马撸起来 :)。

如果您发现此处的备忘单不合适,您可以通过提交 PR 来修复它或提供更好的备忘清单,只针对【中文】用户。以下是开源天使提供的一些备忘清单和快速参考 :)。

其它

@@ -100,7 +110,7 @@ HTML 字符实体 - + Emoji diff --git a/style/style.css b/style/style.css index 616ee04c..0950802d 100644 --- a/style/style.css +++ b/style/style.css @@ -43,7 +43,7 @@ table { border-collapse: collapse } -table td:not(:last-child)>code, ul li > code, kbd { +table td:not(:last-child)>code, table td:not(:last-child)>del>code, ul li > code, kbd { background-color: rgb(51 65 85/0.5); color: rgb(203 213 225/1); box-shadow: 0 0 #0000, 0 0 #0000, 0 0 #0000; @@ -84,6 +84,11 @@ table td:first-child>code { --text-opacity: 1; color: rgb(5 150 105/var(--text-opacity)); } +table td:first-child>del>code { + text-decoration: inherit; + --text-opacity: 1; + color: rgb(244 67 54/var(--text-opacity)); +} table.show-header thead { display: table-header-group; @@ -188,7 +193,7 @@ body.home .h1wrap p { --bg-opacity: 1; } .home-card a svg { - min-width: 1.5rem; + min-width: 1.6rem; height: 1.8rem; } @@ -703,7 +708,6 @@ a.text-grey { /* 代码高亮 End */ - .footer-wrap { margin-top: 3.5rem; color: rgb(100 116 139/1);