From 96657cc25aff6779578f5c5652e220ad14f1aa54 Mon Sep 17 00:00:00 2001 From: Sharemee Date: Sun, 16 Jun 2024 18:06:14 +0800 Subject: [PATCH] add --- _posts/2024-06-05-Npm-command.md | 12 ++++++++++++ _posts/2024-06-13-Docker-with-Redis.md | 27 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 _posts/2024-06-05-Npm-command.md create mode 100644 _posts/2024-06-13-Docker-with-Redis.md diff --git a/_posts/2024-06-05-Npm-command.md b/_posts/2024-06-05-Npm-command.md new file mode 100644 index 0000000..ad96f6f --- /dev/null +++ b/_posts/2024-06-05-Npm-command.md @@ -0,0 +1,12 @@ +--- +layout: post +title: Npm command +--- + +npm install + +--save: 安装的依赖包信息会写到 `package.json` 下的 `dependencies` 节点中 + +--save-dev: 安装的依赖包信息会写到 `package.json` 下的 `devDependencies` 节点中。开发依赖项通常是你只在开发过程中需要的工具,比如测试库、构建工具等。 + +--save-exact:这个选项告诉 `npm` 精确地安装指定版本的包,在 `package.json` 文件中将会精确记录这个版本号,而不是写成1.18.x或者^1.18.0。 diff --git a/_posts/2024-06-13-Docker-with-Redis.md b/_posts/2024-06-13-Docker-with-Redis.md new file mode 100644 index 0000000..99caa33 --- /dev/null +++ b/_posts/2024-06-13-Docker-with-Redis.md @@ -0,0 +1,27 @@ +--- +layout: post +title: Docker with Redis +--- + +## 安装 + +```powershell +# 拉取镜像 +docker pull redis:latest + +# 创建存储卷 +docker volume create redis + +# 创建并运行容器 +docker run ` +--detach ` +--name redis ` +--hostname redis ` +--publish 6379:6379 ` +--volume redis:/data ` +redis:latest +``` + +注意看镜像信息, 若不指定存储卷则其将自动创建一个存储卷 + +自动创建的存储卷的名称是一个哈希字符串, 不便于查看其所属于哪个容器, 因此还是自己指定一个命名的存储卷好些