Skip to content
Docker build secret
hazmi35
OP

2 years ago

I have a Node.js application but I wanted to use my own Dockerfile. I need to use BuildKit's Build Secrets. How do I assign the build secret in railway builds?

Closed

10 Replies

hazmi35
OP

2 years ago

N/A


2 years ago

the service variables are passed in as build args


hazmi35
OP

2 years ago

build args are a different thing


2 years ago

then I'm sorry but you weren't clear in what you are asking



2 years ago

ah gotcha, railway does not support this



maiertech

2 years ago

Is there a secure workaround or does it basically mean that I can't use a Dockerfile if I want to install an NPM package from a private registry, for instance?


maiertech

Is there a secure workaround or does it basically mean that I can't use a Dockerfile if I want to install an NPM package from a private registry, for instance?

2 years ago

Hey, if you want to use environment variables at build time in a Dockerfile, be sure to use it like this:

# 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.


downhilllabs

10 months ago

The problem with ARGS is that they get baked into the image.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...