בעיה בהרצת docker
-
אני מנסה להריץ את הdockerFile על מחשב ווינדוס, אך משום מה מתקבלת שגיאה. אשמח עזרתכם
זה הdockerfile:FROM node:16-alpine as dev
RUN apk --update add postgresql-client--- NETFREE CERT INTSALL ---
ADD https://netfree.link/dl/unix-ca.sh /home/netfree-unix-ca.sh
RUN cat /home/netfree-unix-ca.sh | sh
ENV NODE_EXTRA_CA_CERTS=/etc/ca-bundle.crt
ENV REQUESTS_CA_BUNDLE=/etc/ca-bundle.crt
ENV SSL_CERT_FILE=/etc/ca-bundle.crt--- END NETFREE CERT INTSALL ---
WORKDIR /usr/src/app
COPY package*.json ./
#RUN apk add ca-certificatesRUN npm install
RUN npm install glob rimraf
COPY . .
CMD ["npm", "run", "start:dev"]
FROM node:16-alpine as prod
RUN apk --update add postgresql-clientARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}WORKDIR /usr/src/app
COPY package*.json ./
RUN yarn install --production
COPY . .
COPY --from=dev /usr/src/app/dist ./dist
CMD ["node", "dist/main"]
והשגיאה שאני מקבלת:
-
@חנה34 תנסי להעביר את
RUN apk --update add postgresql-client
לאחרי ההתקנה של התעודה.
ככה:FROM node:16-alpine as dev --- NETFREE CERT INTSALL --- ADD https://netfree.link/dl/unix-ca.sh /home/netfree-unix-ca.sh RUN cat /home/netfree-unix-ca.sh | sh ENV NODE_EXTRA_CA_CERTS=/etc/ca-bundle.crt ENV REQUESTS_CA_BUNDLE=/etc/ca-bundle.crt ENV SSL_CERT_FILE=/etc/ca-bundle.crt --- END NETFREE CERT INTSALL --- RUN apk --update add postgresql-client WORKDIR /usr/src/app COPY package*.json ./ #RUN apk add ca-certificates RUN npm install RUN npm install glob rimraf COPY . . CMD ["npm", "run", "start:dev"] FROM node:16-alpine as prod RUN apk --update add postgresql-client ARG NODE_ENV=production ENV NODE_ENV=${NODE_ENV} WORKDIR /usr/src/app COPY package*.json ./ RUN yarn install --production COPY . . COPY --from=dev /usr/src/app/dist ./dist CM ["node", "dist/main"]
-
לא עזר
-
מה השגיאה?
תשלחי את כל הפלט של הפקודה. -
@חינמי
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 35B 0.0s
=> [internal] load metadata for docker.io/library/node:16-alpine 10.6s
=> [internal] load build context 0.1s
=> => transferring context: 4.44kB 0.0s
=> CACHED https://netfree.link/dl/unix-ca.sh 0.0s
=> CACHED [dev 1/10] FROM docker.io/library/node:16-alpine@sha256:c785e617c8d7015190c0d41af52cc69be 0.0s
=> ERROR [dev 2/10] RUN apk --update add postgresql-client 2.5s[dev 2/10] RUN apk --update add postgresql-client:
#5 0.452 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
#5 2.194 139867018074952:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1919:
#5 2.203 ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.16/main: Permission denied
#5 2.203 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.16/main: No such file or directory
#5 2.204 fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
#5 2.412 139867018074952:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1919:
#5 2.418 ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.16/community: Permission denied
#5 2.419 WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.16/community: No such file or directory
#5 2.419 ERROR: unable to select packages:
#5 2.424 postgresql-client (no such package):
#5 2.424 required by: world[postgresql-client]
executor failed running [/bin/sh -c apk --update add postgresql-client]: exit code: 1
ERROR: Service 'api' failed to build : Build failedזה צילום המסך:
-
@חינמי
תודה רבה!!!
זה באמת היתה הבעיה.
לפני כן העברתי את השורה מלמטה,במקום מלמעלה
יישר כח גדול על העזרה!