Will It Vibe logoWill It Vibe?
DOCKER-013Low severity-4 points

cd used inside RUN instead of WORKDIR

Part of Architecture & Best Practices, which counts for 15% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.

What it detects

A cd inside RUN only affects that one layer, so the directory change is easy to get wrong. WORKDIR sets the directory for every following instruction. Heuristic.

Why it matters

A cd inside a RUN only changes the directory for that single command, so following instructions still run from the previous WORKDIR. It is easy to write a RUN that appears to change directory but does not for later steps. This is a heuristic.

How to fix it

Use a WORKDIR instruction to change directory persistently instead of cd, since WORKDIR applies to every following instruction. A cd is fine only inside a single RUN when chained with && for one command sequence.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Architecture & Best Practices checks