debian
胖大人本胖
共 618 字
预计
9
分钟
安装 nodejs
nodejs
1 2
| apt-get install nodejs apt-get install npm
|
用 nvm 安装node
速度略慢
1 2 3 4 5 6 7
| curl -o- https://ghproxy.com/https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
nvm i 16.16.0
node -v npm -v
|
用 nodesource 安装 node
速度很快
1 2 3 4 5 6
| curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs
node -v npm -v
|
安装docker
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| sudo apt-get update
sudo apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
安装 puppeteer
报错
1 2 3
| apt-get install libnss3-dev apt-get install -y libatk-bridge2.0-dev libatk1.0-dev libcups2-dev libxkbcommon-dev libxcomposite-dev libxdamage-dev libxrandr-dev libgbm-dev libpangox-1.0-dev libasound2-dev
|
中文乱码
1
| apt-get install -y ttf-wqy-zenhei
|
基于debian镜像构建
镜像:1.14G
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| FROM debian:stable-slim
RUN echo "" > "/etc/apt/sources.list" \ && echo "deb http://mirrors.tencentyun.com/debian bullseye main contrib non-free" >> "/etc/apt/sources.list" \ && echo "deb http://mirrors.tencentyun.com/debian bullseye-updates main contrib non-free" >> "/etc/apt/sources.list" \ && echo "deb http://mirrors.tencentyun.com/debian-security bullseye-security main contrib non-free" >> "/etc/apt/sources.list" \ && apt-get update \ && apt-get -y install curl \ && curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \ && apt-get -y install nodejs \ && apt-get -y install ttf-wqy-zenhei librust-gobject-sys-dev libnss3-dev libatk1.0-dev libatk-bridge2.0-dev libcups2-dev libdrm-dev libxcomposite-dev libxkbcommon-dev libxdamage-dev libxrandr-dev libgbm-dev libpangox-1.0-dev libasound2-dev
WORKDIR /app COPY . /app
RUN npm install
EXPOSE 10086 CMD ["node", "app.mjs"]
|
基于node:16.16.0-slim构建
镜像:1.19G
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| FROM node:16.16.0-slim
RUN echo "" > "/etc/apt/sources.list" \ && echo "deb http://mirrors.tencentyun.com/debian bullseye main contrib non-free" >> "/etc/apt/sources.list" \ && echo "deb http://mirrors.tencentyun.com/debian bullseye-updates main contrib non-free" >> "/etc/apt/sources.list" \ && echo "deb http://mirrors.tencentyun.com/debian-security bullseye-security main contrib non-free" >> "/etc/apt/sources.list" \ && apt-get update \ && apt-get -y install ttf-wqy-zenhei librust-gobject-sys-dev libnss3-dev libatk1.0-dev libatk-bridge2.0-dev libcups2-dev libdrm-dev libxcomposite-dev libxkbcommon-dev libxdamage-dev libxrandr-dev libgbm-dev libpangox-1.0-dev libasound2-dev
WORKDIR /app COPY . /app
RUN npm install
EXPOSE 10086 CMD ["node", "app.mjs"]
|