Docker build secret
hazmi35
FREEOP

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?

10 Replies

hazmi35
FREEOP

2 years ago

N/A


2 years ago

the service variables are passed in as build args


hazmi35
FREEOP

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
HOBBY

10 months 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?

10 months 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
PRO

a month ago

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


Loading...