FrankHeijden
FrankHeijden
Explore posts from servers
RRailway
Created by FrankHeijden on 2/20/2024 in #✋|help
Cache mounts MUST be in the format --mount=type=cache,id=<cache-id>
New to railway, trying to deploy a docker image which builds a Node app. The quickstart from github immediately detected the Dockerfile -- yet it seems to immediately fail with the full build log below:
[Region: us-west1]
Cache mounts MUST be in the format --mount=type=cache,id=<cache-id>
[Region: us-west1]
Cache mounts MUST be in the format --mount=type=cache,id=<cache-id>
My dockerfile does not contain mounts with type cache, it only uses mounts with secrets. Is this unsupported by railway?
FROM node:20

RUN apt-get update \
&& apt-get install -y dumb-init

EXPOSE 8081
WORKDIR /app

# Build backend
RUN --mount=type=secret,id=NPM_GITHUB_TOKEN \
NPM_GITHUB_TOKEN=$(cat /run/secrets/NPM_GITHUB_TOKEN) \
npm install
RUN --mount=type=secret,id=SHOPIFY_ACCESS_TOKEN \
ABC_ACCESS_TOKEN=$(cat /run/secrets/ABC_ACCESS_TOKEN) \
npm run build

# Build frontend
WORKDIR ./frontend
RUN --mount=type=secret,id=NPM_GITHUB_TOKEN \
NPM_GITHUB_TOKEN=$(cat /run/secrets/NPM_GITHUB_TOKEN) \
npm install
RUN npm run build

# Run
WORKDIR ..
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["npm", "run", "serve"]
FROM node:20

RUN apt-get update \
&& apt-get install -y dumb-init

EXPOSE 8081
WORKDIR /app

# Build backend
RUN --mount=type=secret,id=NPM_GITHUB_TOKEN \
NPM_GITHUB_TOKEN=$(cat /run/secrets/NPM_GITHUB_TOKEN) \
npm install
RUN --mount=type=secret,id=SHOPIFY_ACCESS_TOKEN \
ABC_ACCESS_TOKEN=$(cat /run/secrets/ABC_ACCESS_TOKEN) \
npm run build

# Build frontend
WORKDIR ./frontend
RUN --mount=type=secret,id=NPM_GITHUB_TOKEN \
NPM_GITHUB_TOKEN=$(cat /run/secrets/NPM_GITHUB_TOKEN) \
npm install
RUN npm run build

# Run
WORKDIR ..
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["npm", "run", "serve"]
26 replies