小编Dai*_*ung的帖子

Docker 节点:Alpine-12:如何在 Dockerfile 中安装 Chromium 73?

因为我想运行 Puppeteer@1.19 但在 page.pdf() 中遇到错误。

刚刚提到的一些 blob 将 Chromium 从版本 76 降级到 73。如何使用 node:alpine-12 在 Dockerfile 中做到这一点?谢谢

以下是我的设置(铬版本为 76):

FROM node:12-alpine
########## 
## Setting for using Puppeteer (for using node:XX-alpine)
##########    
ENV CHROME_BIN="/usr/bin/chromium-browser"\
    PUPPETEER_SKIP_CHROMIUM_DOWNLOAD="true"
########## 
## Update and Install packages
##########
RUN set -x \
    && apk update \
    && apk upgrade \
    && echo "127.0.0.1 localhost" >> /etc/hosts \
    && echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" > /etc/apk/repositories \
    && echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
    && echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \
    # add …
Run Code Online (Sandbox Code Playgroud)

chromium node.js docker alpine-linux puppeteer

10
推荐指数
1
解决办法
8451
查看次数

为什么内存使用量比我在 Kubernetes 的节点中设置的要大?

我仅将资源分配给 1 个 pod,内存为 650MB/30%(使用其他内置 pod,限制内存仅为 69%)

但是在pod处理过程中,pod的使用率在650MB以内,但是node的整体使用率为94%。

为什么会发生,因为它的上限应该是 69%?是不是因为其他内置的 pod 没有设置限制?如果内存使用率 > 100%,有时我的 pod 会出错,如何防止这种情况发生?

我的分配设置 ( kubectl describe nodes): 在此处输入图片说明

Kubernetes Node 和 Pod 空闲时的内存使用情况:
kubectl top nodes
在此处输入图片说明
kubectl top pods
在此处输入图片说明

运行任务时 Kubernetes Node 和 Pod 的内存使用情况:
kubectl top nodes
在此处输入图片说明
kubectl top pods
在此处输入图片说明


进一步测试的行为:
1. 在命名空间test-ns下准备部署、pods 和服务
2. 由于只有kube-systemtest-ns有 pods,所以分配 1000Mi 给它们每个 (from kubectl describe nodes) 目标是小于 2GB
3. 假设内存在kube-systemtest-ns 中使用将小于 2GB 小于 100%,为什么内存使用率可以是 106%?

.yaml …

nodes memory-limit kubernetes azure-aks

7
推荐指数
1
解决办法
3787
查看次数

如何处理错误“拨号 tcp 10.240.0.4:10250: i/o timeout”以在 AKS 中查看 pod 日志?

在我可以运行此命令kubectl logs <pod>而没有问题很多天/版本之前。但是,在我最近推送另一个映像并部署后,我遇到了以下错误:

来自服务器的错误:获取https://aks-agentpool-xxx-0:10250/containerLogs/default/ <-pod->/<-service->: 拨号 tcp 10.240.0.4:10250: i/o 超时

我尝试重新构建和重新部署但失败了。

以下是供参考的节点信息: 节点信息

timeout tcp kubernetes kubectl azure-aks

7
推荐指数
1
解决办法
1万
查看次数

NodeJS 与 Puppeteer:如何设置每个页面的边距(或缩放所有页面以适应页边距)?

我尝试仅使用以下设置,但结果页眉和页脚位置将会更改。请指教。

await page.pdf({
    path: FILENAME,
    format: 'A4',
    margin: {
        top: "0px",
        right: "0px",
        bottom: "0px",
        left: "0px"
    },
    printBackground: true // required for photos otherwise blank
});
Run Code Online (Sandbox Code Playgroud)

margin scale node.js docker puppeteer

6
推荐指数
1
解决办法
9239
查看次数

可以在 NodeJS 代码中使用 Azure Pipelines 中的变量吗?

可以在 NodeJS 代码中使用 Azure Pipelines(构建/发布)中的变量吗?

如果没有,在 WebApp 中设置的变量是否也可以在 NodeJS 代码中使用?

我在管道的构建和发布中以及 .yaml 文件中的以下环境设置中设置了变量 TESTING & TESTING2:

spec:
  containers:
  - name: devops
      env:
      - name: TESTING
        value: $(TESTING)
Run Code Online (Sandbox Code Playgroud)

然后只是尝试在 NodeJS 中打印:

process.env.TESTING --> $(TESTING)

process.env.TESTING2 --> 未定义

这对我不起作用。

variables node.js docker azure-devops azure-pipelines

5
推荐指数
1
解决办法
1995
查看次数

如何从状态“False(MissingEndpoints)”启用 kube-system/metrics-server?

我的指标服务器突然无法工作并得到以下信息:

$ kubectl get apiservices |egrep metrics
v1beta1.metrics.k8s.io kube-system/metrics-server False (MissingEndpoints)
Run Code Online (Sandbox Code Playgroud)

我尝试在下面实现但仍然不行:

$ git clone https://github.com/kubernetes-incubator/metrics-server.git
$ cd metrics-server
$ kubectl apply -f deploy/1.8+/
Run Code Online (Sandbox Code Playgroud)

请指教,谢谢。

metrics azure kubernetes azure-aks

5
推荐指数
2
解决办法
1万
查看次数

如何在 Docker 中使用 Chromium v​​77 运行 NodeJS puppeteer?

Alpine 于 80 月 8 日支持 Chromium v​​77。

参考:https : //pkgs.alpinelinux.org/packages?name=chromium&branch=edge

尝试复制下载 Chromium v​​77 并运行 Puppeteer v1.20 的步骤,但在运行时出现错误:

Error for printPdf()
{}
Error: Failed to launch chrome!
Error relocating /usr/lib/chromium/chrome: _ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found
Error relocating /usr/lib/chromium/chrome: _ZNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev: symbol not found
Error relocating /usr/lib/chromium/chrome: hb_subset_input_set_retain_gids: symbol not found
Error relocating /usr/lib/chromium/chrome: _ZNSt19_Sp_make_shared_tag5_S_eqERKSt9type_info: symbol not found


TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (/usr/src/app/node_modules/puppeteer/lib/Launcher.js:348:14)
    at Interface.<anonymous> (/usr/src/app/node_modules/puppeteer/lib/Launcher.js:337:50)
    at Interface.emit (events.js:214:15)
    at Interface.close (readline.js:403:8)
    at Socket.onend (readline.js:180:10)
    at Socket.emit (events.js:214:15)
    at endReadableNT (_stream_readable.js:1178:12)
    at …
Run Code Online (Sandbox Code Playgroud)

chromium node.js docker alpine-linux puppeteer

2
推荐指数
1
解决办法
2869
查看次数

Azure Web 服务 [Web App for Containers (linux)] - 如何定期防止超时

Web Services 定期出现错误日志:

错误 - 站点 YYY 的容器 XXX 未在预期时间限制内启动。经过的时间 = 230.3790706 秒

我设置了微软博客中已经提到的以下设置,但仍然失败:

1. Use the EXPOSE instruction in your Dockerfile to expose port 3000.
2. Use the WEBSITES_PORT app setting with a value of "3000" to expose that port.
Run Code Online (Sandbox Code Playgroud)

如何配置来防止此错误?

web-services timeout azure azure-web-app-service azure-web-app-for-containers

1
推荐指数
1
解决办法
3200
查看次数