node.js - apt-get install -y nginx 更新版本
问题描述
在 Dockerfile 中:
FROM node:8
RUN apt-get update && apt-get install -y \
nginx
我想我以这种方式得到了一个非常旧版本的 nginx。如何安装较新的版本,例如 1.15.7?我可以做类似的事情:
FROM node:8
RUN apt-get update && apt-get install -y \
curl \
# Where to download the nginx source? Pass the download path below
&& curl -sL \
&& apt-get install -y nginx
解决方案
Node:8 使用 debian 拉伸,所以
1. 在文本编辑器中打开 /etc/apt/sources.list 并在底部添加以下行:
deb http://nginx.org/packages/mainline/debian/ stretch nginx
- 导入存储库的包签名密钥并将其添加到 apt:
sudo wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
- 安装 nginx
sudo apt update
sudo apt install nginx
推荐阅读
- r - min(which()) 在条件下没有检索到正确的数字
- javascript - Discord.js 需要帮助 TypeError: Cannot read property 'send' of undefined
- javascript - 如何在 Jquery 中添加 Javascript 等元素 - 表格问题
- android - 无法在 Android 嵌入式浏览器上使用 Facebook 登录
- date - 如何将以下字符串转换为日期或时间戳?
- excel - 在 Excel 表中查找匹配对并在不存在时创建新对
- xcodebuild - 将变量从 Codebuild 传递到我的剧本
- angular - 加载 Firebase SDK 时出错,请检查控制台
- php - PHP - Laminas DB 是否支持无参数调用存储过程?
- stripe-payments - Stripe Connect 直接收费错误:令牌 ID 无效