Skip to content

Commit

Permalink
chore:12月28日
Browse files Browse the repository at this point in the history
  • Loading branch information
aehyok committed Dec 28, 2023
1 parent f66b66d commit 99734bc
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 5 deletions.
3 changes: 3 additions & 0 deletions docs/daily/2023-12.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 12月28日
- linux docker alpine apk add xxxx
- https://learn.microsoft.com/zh-tw/dotnet/core/install/linux-alpine
## 12月26日
- docker官方文档
- https://docs.docker.com/engine/reference/commandline/images/#filter
Expand Down
2 changes: 1 addition & 1 deletion docs/javascript/2023-11-20-rabbitmq.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ docker search rabbitmq
docker pull rabbitmq
docker run -itd --rm --name rabbitmq -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin -p 15672:15672 -p 5672:5672 rabbitmq
docker run -restart always -itd --name rabbitmq -e RABBITMQ_DEFAULT_USER=admin -e RABBITMQ_DEFAULT_PASS=admin -p 15672:15672 -p 5672:5672 rabbitmq
// 15672进入rabbitmq数据管理后台的
上面创建并运行容器后其实已经设置用户名和密码来登录15672: admin admin
Expand Down
2 changes: 1 addition & 1 deletion docs/javascript/2023-11-28-redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
docker run --restart always -itd --name redis -p 16379:6379 redis --ignore-warnings ARM64-COW-BUG
// 查看容器是否运行
docker ps
dock
// 再查看容器日志(查看是否启动成功)
docker logs redis
Expand Down
4 changes: 1 addition & 3 deletions docs/javascript/2023-12-23-net8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,9 @@ docker run -d --name nginx --network mynetwork -p 80:80 -v /path/to/nginx/conf:/
docker run -d --name nginx --network mynetwork -p 80:80 -v /root/github/NET8.0/nginx.conf:/etc/nginx/conf.d/dvs.conf nginx
docker run -d --name nginx -p 80:80 -v /root/github/NET8.0/nginx.conf:/etc/nginx/conf.d/default.conf nginx
docker run --restart always -itd --name nginx -p 80:80 -v /root/github/NET8.0/nginx.conf:/etc/nginx/conf.d/default.conf nginx
// 创建容器专属网络
docker network create -d bridge aehyok
```
138 changes: 138 additions & 0 deletions docs/javascript/2023-12-28-ubuntu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
## ubuntu说明
```
//安装工具
apt-get install xxxx
```

## 准备安装docker
- 参考 https://juejin.cn/post/7314968141280051240?searchId=20231228192336770F203FBB57DC35F323

```
// 更新包索引并安装添加新 HTTPS 存储库所需的依赖项
sudo apt update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
//添加 Docker 的官方 GPG 密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
// 添加Docker存储库
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
// 更新软件包索引并安装 Docker Engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
```

## 开启Docker
```
// 启动docker守护进程
systemctl start docker
// 配置让docker服务岁系统自动启动
systemctl enable docker
// 取消开机自动启动
systemctl disable docker
// 停止docker服务
systemctl stop docker
// 查看docker版本,确认docker是否安装成功
docker version
```


## 安装git
```
// 安装git
apt-get install git
// 查看git版本
git version
// 查看OpenSSH版本
ssh -V
// 生成ssh密钥对
ssh-keygen -t rsa -b 4096
// 一路默认即可,生成
// 生成的路径一般在/root/.ssh/
// 查看
ls -li
920236 -rw------- 1 root root 406 Dec 28 19:12 authorized_keys
919704 -rw------- 1 root root 3369 Dec 28 19:39 id_rsa
919708 -rw-r--r-- 1 root root 737 Dec 28 19:39 id_rsa.pub
一般是将id_rsa.pub拷贝到服务器或者直接将里面的长字符串进行配置后使用
我这里是将id_rsa.pub 拷贝到了github上用来拉去项目的
```

## 准备mysql redis rabbitmq
```
cd /root
mkdir docker
cd docker
mkdir redis
mkdir mysql
mkdir rabbitmq
```

## redis 配置
- 配置文件位置
- 英文版 https://raw.githubusercontent.com/antirez/redis/7.0/redis.conf
- 中文版 https://juejin.cn/post/7316794084998348851?searchId=20231228200452F893C938CCCBA53BD65F

我这里主要修改了
- 英文版中的requirepass密码 然后拷贝到/root/docker/redis/conf中去了
- # bind 127.0.0.1 -::1 将这一行暂时注释掉

```
docker run --restart=always \
-p 6379:6379 \
--name redis \
-e "TZ=Asia/Shanghai" \
-v /root/docker/redis/conf/redis.conf:/etc/redis/redis.conf \
-v /root/docker/redis/data:/data \
-itd redis:7.0.12 redis-server /etc/redis/redis.conf
```

## mysql配置
- https://www.jianshu.com/p/e8a4ac2a92e0
```
docker run --name mysql \
--restart always \
--privileged=true \
-p 13306:3306 \
-v /root/docker/mysql/log:/var/log/mysql \
-v /root/docker/mysql/conf/my.cnf:/etc/mysql/my.cnf \
-v /root/docker/mysql/data:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD="M9y2512!" \
-e MYSQL_USER="root" \
-e MYSQL_PASSWORD="M9y2512!" \
-d mysql:8.0
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'M9y2512!';
FLUSH PRIVILEGES;
```


## git拉取项目
```
cd /root
// 创建目录,并cd过去
mkdir github
cd github
//克隆项目
git clone [email protected]:aehyok/NET8.0.git
//给脚本授权
chmod 777 run.sh
```

0 comments on commit 99734bc

Please sign in to comment.