hardStudy question · answer published in Node.js interview questions, so no pointsdockercontainer-securitysecrets-management
Deleted secret still in the image
This Dockerfile copies an npm token, uses it, then deletes it. A scan still finds the token in the pushed image. What is the right fix?
FROM node:22-alpine WORKDIR /app COPY .npmrc package*.json ./ RUN npm ci RUN rm .npmrc COPY . .
Discussion 0
Join free to post in the discussion.
Related questions
- Ordering Dockerfile steps for cachingDevOps Engineer
- Image vs containerDevOps Engineer
- Why use a .dockerignore fileDevOps Engineer
- Container exits right after startDevOps Engineer
- Are Kubernetes Secrets encryptedDevOps Engineer
- Why use Vault dynamic secretsDevOps Engineer
- Why use a minimal base imageDevOps Engineer
- When to scan container imagesDevOps Engineer