Skip to content
Two questions: digest-pinned private images and writing a root-owned file to a volume
leopoldojacobsen
OP

15 days ago

Hi Railway team, we're on Pro and need to confirm two things before relying on them:

  1. Private GHCR image pinned by digest: can a service use ghcr.io/<org>/<pkg>@sha256:<digest> (no tag) with registry credentials, and is that exact digest always the one pulled on redeploy, restart and rollback, never re-resolved or auto-updated?

  2. Root-owned file on a volume: our app runs as non-root (UID 10001) and must only read a small file on its mounted volume. Is there a supported way to write or replace that file as root (owner 0:0, atomic replace), without changing the service's user or start command? For example railway ssh as root, the volume file upload, or a short-lived root container on the same volume. If none exists, please say so.

Thanks!

Solved

3 Replies

Status changed to Awaiting Railway Response Railway • 15 days ago


15 days ago

On the private GHCR image, the registry credentials saved on a service are used when it deploys, but automatic image update checks do not use them, so auto-updates cannot discover new versions of a private image. We have not yet verified whether a digest-only reference is always pulled unchanged on redeploy, restart and rollback, so we cannot confirm that guarantee at this point.

On the volume, volumes are mounted as root, and the documented setting for images that run as a non-root user is RAILWAY_RUN_UID=0. That changes the user the service runs as, so it does not meet your constraint. The CLI can upload, rename and edit files on a volume with railway volume files upload and railway volume files rename (see railway volume). We have not verified which owner those files get or whether a replace is atomic, so we cannot confirm that as a supported way to produce a 0:0 file.


Status changed to Awaiting User Response Railway • 15 days ago


leopoldojacobsen
OP

15 days ago

Thanks! Follow-ups:

  1. Does railway ssh into a running service execute as root (uid 0) inside the service's own container/mount namespace, and is that a supported, authenticated way to write a file on the attached volume?

  2. Is there a supported way to create a file on a volume privately from creation (e.g. 0600 while being written), then make it 0444 owned by 0:0 with an atomic replace, without changing the service user?

  3. For digest-pinned private images: any ETA on confirming that redeploy/restart/rollback always pull exactly the pinned digest?


Status changed to Awaiting Railway Response Railway • 15 days ago


15 days ago

On SSH, railway ssh opens a shell inside your deployed service's own container, and it authenticates with an SSH key registered to your Railway account or workspace. Because it runs in that container, the attached volume is visible at its mount path, and scp and sftp transfers over the same connection reach the container filesystem, including the mounted volume (railway ssh). We have not verified which UID the SSH session runs as, so we cannot confirm that it executes as root.

On writing a file that is private from creation and then replaced atomically as 0444 owned by 0:0, we have not verified a supported path that guarantees those permissions, that ownership and an atomic replace without changing the service user. That applies to SSH and to the volume file commands alike.

On the digest-pinned private image, we don't have a confirmation or a timeline to share for whether redeploy, restart and rollback always pull exactly the pinned digest.


Status changed to Awaiting User Response Railway • 15 days ago


Railway
BOT

7 days ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway • 7 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...