CIFS mounting

radzTRIAL

9 months ago

Hi,

I'm trying to mount a CIFS share in my Docker container on Railway.app, but I'm encountering the following error:

Unable to apply new capability set.

I have an entrypoint.sh that looks like

#!/bin/bash

# Check if any of the variables are empty
if [ -z "${CIFS_USERNAME}" ] || [ -z "${CIFS_PASSWORD}" ] || [ -z "${CIFS_SERVER}" ] || [ -z "${CIFS_SHARE}" ]; then
  echo "Error: One or more required environment variables are missing."
  exit 1
fi

# Attempt to mount the CIFS share
mount -t cifs -o username=${CIFS_USERNAME},password=${CIFS_PASSWORD},uid=1000,gid=1000 //${CIFS_SERVER}/${CIFS_SHARE} /mnt/test

# Check if the mount command succeeded
if [ $? -ne 0 ]; then
  echo "Error: Failed to mount CIFS share."
  exit 1
fi

# Execute the main command of the Docker container
exec "$@"

My Questions:

  • Is mounting a CIFS share possible in a Railway.app container? If so, how can I resolve the "Unable to apply new capability set" error?

  • If direct CIFS mounting isn't supported, are there any recommended workarounds or alternative approaches for accessing a network file share in this environment?

Thanks in advance for any guidance or suggestions!

1 Replies

9 months ago

Hello,

This is not something you could do on Railway for a few reasons, mainly that the containers are not run with the needed privileges that would allow this, if you need to access a network share of any kind it would need to be done through a software interface.