我可以从我的 Dockerfile 中删除 `运行 apk add --no-cache python2 g++ make` 吗?

Can I remove `RUN apk add --no-cache python2 g++ make` from my Dockerfile?

docker tutorial 我正在关注它告诉我将以下命令放入我的 Dockerfile:

# syntax=docker/dockerfile:1
FROM node:12-alpine
RUN apk add --no-cache python2 g++ make
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "src/index.js"]

我了解所有线路的作用,除了:

RUN apk add --no-cache python2 g++ make

没有它似乎一切正常。我可以从 Dockerfile 中删除这一行吗?删除这条线会不会给我带来麻烦?为什么我在这个节点项目中需要任何“python”?

正在阅读 PR which added that line, it seems like it was added to fix an issue with Apple M1 support for the node-gyp package. A later PR took the line back out,但 docker 网站上似乎没有反映该更改。

这确实回避了为什么它在 M1 上坏了的问题,但我没有 M1 笔记本电脑,所以我无法回答这个问题。