Review the Dockerfile
A ChaiCorp developer opened a pull request with a new Dockerfile for the orders API. You are the reviewer. You also listed the project folder and its .dockerignore, because COPY . . copies whatever the folder contains into the image.
Find the problems. Each answer is a fact you can read from the files below.
FROM node:latest LABEL maintainer="dev@chaicorp.example" ENV NODE_ENV=production ENV DB_HOST=db.internal.chaicorp.example ENV DB_USER=orders_app ENV DB_PASSWORD=Chai@Orders2026! WORKDIR /app RUN apt-get update && apt-get install -y curl git vim netcat-traditional RUN curl -fsSL https://get.tools-installer.example/install.sh | sh COPY . . RUN npm install EXPOSE 3000 22 USER root CMD ["node", "server.js"]
$ ls -a . .. .dockerignore .env .git Dockerfile node_modules package.json package-lock.json server.js src $ cat .dockerignore node_modules npm-debug.log
Need help? Review: How Attackers Think · Passwords and Hashing
Q1. Which tag makes the base image unpinned, so every build can pull a different version?
Q2. Which environment variable holds a hardcoded secret?
Q3. Which user will the application run as inside the container?
Q4. A script is downloaded and run straight into sh without any check. Which domain does it come from?
Q5. Which file that usually holds secrets will be copied into the image because .dockerignore does not exclude it?
Q6. What is the safest way to give the container its database password?