a month ago
Message:
Hello Railway Support Team,
I am experiencing a persistent issue where my service is stuck using an outdated cached Docker image, even after multiple attempts to force a clean rebuild.
Despite renaming the Dockerfile, deleting it, recreating it, pushing new commits, and removing all previous deployments, the build logs continue to show cached layers that no longer exist in the current repository.
The logs still display:
Código
WORKDIR /app/backend cached
COPY backend/package*.json ./backend/ cached
WORKDIR /app cached
However, my current Dockerfile does not contain these lines anymore. Railway is also attempting to start the service using a path that no longer exists:
Código
/app/backend/backend/dist/server.js
This indicates that the build system is using an outdated Dockerfile and a stale cached image, ignoring the current state of the repository.
I need your assistance to:
Clear the build cache for this service, or
Force a full rebuild from scratch, bypassing all cached layers.
This issue is blocking deployment entirely, and no local or repository-side changes have any effect on the build process.
Thank you in advance for your help. Please let me know once the cache has been cleared or if you need any additional information.
Best regards, Luis
1 Replies
a month ago
try adding --no-cache to your Dockerfile build. You can do this in Railway settings ->Build -> add --no-cache to Docker build arguments. Also is the dockerfile in the root of your repo, or in a subdirectory? If railway's root directory setting is pointing to the wrong path, it might be picking
up a cached build from a previous directory structure.