tls: failed to verify certificate: x509: certificate signed by unknown authority
Is it a good practice to add --insecure
flag?
ARG IMAGE_TAG=node:22-bookworm-slim
FROM ${IMAGE_TAG} AS builder
WORKDIR /app
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update && \
apt-get --no-install-recommends install -y openssl && \
rm -rf /var/lib/apt/lists/*
COPY package.json package-lock.json tsconfig.json ./
COPY prisma/schema.prisma ./
RUN --mount=type=cache,target=/app/.npm \
npm set cache /app/.npm && \
npm ci
COPY . .
RUN npx prisma generate && npm run build
FROM builder AS scan
COPY --from=aquasec/trivy /usr/local/bin/trivy /usr/local/bin/trivy
RUN trivy fs /app --severity=HIGH,CRITICAL --ignore-unfixed --exit-code=1