In the docker tutorial I'm following it tells me to put the following commands in my 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"]
I understand what all of the lines are doing, except for:
RUN apk add --no-cache python2 g++ make
And everything seems to work without it. Can I delete this line from my Dockerfile? Will deleting this line cause problems for me down the road? Why do I need anything "python" in this node project?
Reading the 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, but that change does not seem to be reflected on the docker website.
That does beg the question of why it breaks on M1, but I don't have an M1 laptop, so I can't answer that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With