See the value of my Docker CMD with env var?
ched-dev
PROOP

a year ago

Hello, I am trying to deploy a Dockerfile which runs a command:

CMD /pb/pocketbase serve --dir=$RAILWAY_VOLUME_MOUNT_PATH --http=0.0.0.0:8008

Since it uses an environment variable, is there anywhere I can see the command value actually run? I want to confirm it is getting loaded correctly.

Solved$10 Bounty

3 Replies

a year ago

If your base image has bin/sh available (i.e. alpine/debian/ubuntu base) you can do the following:

CMD ["/bin/sh","-c","echo \"Starting with dir: ${RAILWAY_VOLUME_MOUNT_PATH}\"; exec /pb/pocketbase serve --dir=\"${RAILWAY_VOLUME_MOUNT_PATH}\" --http=0.0.0.0:8008"]

ched-dev
PROOP

a year ago

I am using alpine. That works for me, thanks!


10 months ago

!s


Status changed to Solved noahd 11 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...