13 days ago
I have a Dockerfile
In the build stage I need a token which is populated from a railway variable (specifically for doppler)
I added a debug line in the docker file to check to make sure the doppler token is available, and also checked the length
The variable is available in both local and railway
BUT on my local it shows the correct length of 60
Where as Railway ONLY shows length of 5, which happens to be the same length you get if you try to copy the token on RAILWAY as copying it gives "*****"
So then I made a new variable in railway called it FAKE_TEST
now that variable is not being recognized AT ALL in the build on railway
NOTE that In my local I am able to build correctly when I run with:
docker build --build-arg DOPPLER_TOKEN=$DOPPLER_TOKEN -t your-image-name .
On railway it keeps throwing error:
builder
RUN doppler run -- pnpm run build
213ms
Unable to download secrets
Doppler Error: Invalid Auth token
Here is a snippet from my dockerfile
ARG DOPPLER_TOKEN
ARG FAKE_TEST
# Install Doppler CLI here .. omitted for simplicity
# debug lines..
doppler run --token="${DOPPLER_TOKEN}" -- pnpm run build;I have also tried this as well which also doesnt work either
ARG FAKE_TEST
ENV FAKE_TEST=${FAKE_TEST}ARG DOPPLER_TOKEN
ENV DOPPLER_TOKEN=${DOPPLER_TOKEN}4 Replies
13 days ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
13 days ago
hey, in the Dockerfile stage add ARG DOPPLER_TOKEN and use it before your doppler build step. https://docs.railway.com/guides/dockerfiles#using-variables-at-build-time you need to pass them:
For example:
# Specify the variable you need
ARG RAILWAY_SERVICE_NAME
# Use the variable
RUN echo $RAILWAY_SERVICE_NAME
Be sure to declare your environment variables in the stage they are required in:
FROM node
ARG RAILWAY_ENVIRONMENTyou can as well move to using railpack, which is railway's standard which will by default support your use-case of directly passing envs
yeeet
hey, in the Dockerfile stage add ARG DOPPLER_TOKEN and use it before your doppler build step. https://docs.railway.com/guides/dockerfiles#using-variables-at-build-time you need to pass them:For example: # Specify the variable you need ARG RAILWAY_SERVICE_NAME # Use the variable RUN echo $RAILWAY_SERVICE_NAME Be sure to declare your environment variables in the stage they are required in: FROM node ARG RAILWAY_ENVIRONMENTyou can as well move to using railpack, which is railway's standard which will by default support your use-case of directly passing envs
13 days ago
I mentioned this in my opening thread. I have already tried that. Railway does not seem to be injecting variables properly.
I even made a dummy variable to see if that would work.
13 days ago
You have yet to deploy the changes after adding the variables to your service.
Status changed to Solved brody • 13 days ago