Build cache deploying old/removed Dockerfile commands — cannot clear
sander-sandman
HOBBYOP

4 months ago

My service is deploying a cached Dockerfile with phantom commands that were removed from the repo weeks ago. Build logs show:

[7/11] RUN groupadd -r signetra && useradd -r -g signetra signetra

[10/11] RUN chown -R signetra:signetra /app /app/data

These commands do NOT exist in my current Dockerfile or anywhere in the repository. The result: Playwright browsers install as root but the app runs as the phantom "signetra" user, causing permission failures.

What I've tried:

- Completely rewrote the Dockerfile 5+ times

- Multiple railway up --detach and railway redeploy --yes

- Unlinked and relinked the service

- Added railway.json with nocache settings

- Nothing clears the cached layers

Project ID: 8d1dea14-c460-4e3f-adae-8f09982d9bfd

Service ID: 4aa5c31b-306b-4035-8ad8-f066490c5f9c

Environment: production

Repo: https://github.com/sander-sandman/signetra

Request: Please clear the Docker build cache for this service so it rebuilds from the current Dockerfile.

$10 Bounty

1 Replies

Status changed to Awaiting Railway Response Railway 4 months ago


a month ago

This sounds less like layer cache and more like Railway building a different Dockerfile/context than you think.

Cache can reuse layer output, but the build log step text still comes from the Dockerfile used for that build. If those RUN groupadd... lines are not anywhere in the current repo, I’d first prove which Dockerfile Railway is actually using.

Add a temporary line near the top of the Dockerfile you expect Railway to use:

RUN echo BUILD_MARKER_20260525 && false

Redeploy. If the build does not fail there, Railway is not using that Dockerfile/context. Then check service Source root directory and explicit Dockerfile path in railway.toml / service settings. NO_CACHE won’t fix the wrong build context.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...