-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` | ||
|
||
注意看镜像信息, 若不指定存储卷则其将自动创建一个存储卷 | ||
|
||
自动创建的存储卷的名称是一个哈希字符串, 不便于查看其所属于哪个容器, 因此还是自己指定一个命名的存储卷好些 |