I am looking to build a docker image and its been literally years since I've had to do this, and I've forgotten most everything I've learned about docker. I wanted to test locally before uploading to GCP.
Re: I'm updating from node:12.*
Anyways, this is my dockerfile:
FROM node:16-alpine
RUN echo "deb http://nginx.org/packages/mainline/debian/ stretch nginx \deb-src http://nginx.org/packages/mainline/debian/ stretch nginx" > /etc/apt/sources.list.d/nginx.list && wget -qO - https://nginx.org/keys/nginx_signing.key | apt-key add -
RUN apt update -y && apt install -y nginx build-essential gyp libpng-dev bzip2 autoconf libtool nasm libvips-dev --no-install-recommends && rm -rf /var/lib/apt/lists/* && mkdir -p /usr/src/app
COPY ./package.json /usr/src/app/
WORKDIR /usr/src/app/
RUN npm install -g node-gyp
And I am getting this error:
Step 1/6 : FROM node:16-alpine
---> 2573171e0124
Step 2/6 : RUN echo "deb http://nginx.org/packages/mainline/debian/ stretch nginx \deb-src http://nginx.org/packages/mainline/debian/ stretch nginx" > /etc/apt/sources.list.d/nginx.list && wget -qO - https://nginx.org/keys/nginx_signing.key | apt-key add -
---> Running in ff30404cf27a
/bin/sh: can't create /etc/apt/sources.list.d/nginx.list: nonexistent directory
The command '/bin/sh -c echo "deb http://nginx.org/packages/mainline/debian/ stretch nginx \deb-src http://nginx.org/packages/mainline/debian/ stretch nginx" > /etc/apt/sources.list.d/nginx.list && wget -qO - https://nginx.org/keys/nginx_signing.key | apt-key add -' returned a non-zero code: 1
Now, that makes sense because I do NOT have this directory - but I updated this 3 years ago and don't remember coming across it. But more than that - if I don't have that directly locally (I do run nginx) - is there a way to silence it? I tried to create it and got permission issues.