BuildKit executing wrong Dockerfile despite correct root directory and NO_CACHE=1
chicogonzales
HOBBYOP

a day ago

I have a monorepo with two services. Service A (agent-runtime) has been running fine. Service B (mcp-gateway) is new, with root directory set to services/mcp-gateway.

Build log confirms "found 'Dockerfile' at 'services/mcp-gateway/Dockerfile'" but then executes instructions from Service A's Dockerfile instead.

My gateway Dockerfile contains FROM node:20-slim but build shows node:20-alpine. My Dockerfile has zero COPY agents/ lines but build copies 15+ agent files. NO_CACHE=1 is set, log shows "Caching Disabled", yet every layer says "cached".

Tried: NO_CACHE=1, RAILWAY_DOCKERFILE_PATH env var, clearing/setting Dockerfile Path in Settings, renaming Dockerfile, changing base image, ARG CACHE_BUST, LABEL, unique stage names, deleting and recreating the service.

Is there a way to purge the BuildKit cache for a specific service/builder?

$10 Bounty

0 Replies

Status changed to Open Railway about 24 hours ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...