"Cache mount ID is not prefixed with cache key" when deploying with Docker
vitormarkis
HOBBYOP

2 years ago

Do I need to hard code the RAILWAY_SERVICE_ID value on my Dockerfile?

Hardcoding the value works, but whenever I try to accept this value as a build argument, I receive the error bellow

Dockerfile:

ARG RAILWAY_SERVICE_ID

RUN --mount=type=cache,id=s/${RAILWAY_SERVICE_ID}-/pnpm/store,target=/pnpm/store pnpm install --prod --frozen-lockfile

And these are my logs:

[Region: us-west1]
Cache mount ID is not prefixed with cache key

3 Replies

2 years ago

Yes you do need to hardcode it.


2 years ago

Is there any plan to support it without harcoding it? Don't think Dockerfile should includes information about the service. It makes Dockerfile not only coupled to railway but also to a specific customer service...


coss
PRO

4 months ago

Bump. The build cache is not really usable for scalable applications in this state..


Loading...