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

2 months 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

0 Replies

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
HOBBYOP

2 months ago

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


noahd
EMPLOYEE

2 months ago

!s


Status changed to Solved noahd 2 months ago


Status changed to Solved noahd 2 months ago


Loading...