Skip to content

Commit

Permalink
Add 常用语言
Browse files Browse the repository at this point in the history
  • Loading branch information
YangRucheng committed Oct 7, 2024
1 parent 4c6f344 commit e6d6f5c
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions source/_posts/常用命令记录.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ systemctl restart docker
### 安装Portainer

#### 安装社区版
#### 安装Portainer社区版

```bash
docker run -d \
Expand All @@ -114,7 +114,7 @@ docker run -d \
portainer/portainer-ce
```

#### 安装 Agent
#### 安装PortainerAgent

```bash
export EDGE_ID=""
Expand All @@ -138,11 +138,11 @@ docker run -d \
# 创建网络, 以便后续使用
network_name="network"

if docker network ls | grep -q "$network_name"; then
echo "网络 '$network_name' 已存在"
if docker network ls | grep -q "network"; then
echo "网络已存在"
else
docker network create --driver bridge --gateway=172.18.0.1 --subnet=172.18.0.0/24 "$network_name"
echo "网络 '$network_name' 创建成功"
docker network create --driver bridge --gateway=172.18.0.1 --subnet=172.18.0.0/24 network
echo "网络创建成功"
fi
```

Expand Down Expand Up @@ -355,3 +355,31 @@ volumes:
external: true
name: HomeAssistant
```

## 安装常用语言

### 安装Go

```bash
GO_VERSION="1.23.2"
DEVICE="linux-amd64" # linux-amd64 / linux-arm64
GO_URL="https://golang.google.cn/dl/go$GO_VERSION.$DEVICE.tar.gz"
wget -O go.tar.gz $GO_URL
sudo tar -C /usr/local -xzf go.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
source ~/.bashrc
go version
```

### 安装NodeJs

```bash
NODE_VERSION="20.18.0"
DEVICE="linux-x64" # linux-x64 / linux-arm64
NODE_URL="https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-$DEVICE.tar.xz"
wget -O node.tar.xz $NODE_URL
sudo tar -C /usr/local --strip-components 1 -xf node.tar.xz
echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bashrc
source ~/.bashrc
node -v && npm -v
```

0 comments on commit e6d6f5c

Please sign in to comment.