Skip to content

Instantly share code, notes, and snippets.

@yardbirdsax
Last active October 5, 2019 20:15
Show Gist options
  • Save yardbirdsax/f0e425230a49173877b21a9f3d691c67 to your computer and use it in GitHub Desktop.
Save yardbirdsax/f0e425230a49173877b21a9f3d691c67 to your computer and use it in GitHub Desktop.
How to have bind-mount volumes in Docker owned by non root users
#!/bin/bash
chown -R demo:demo /data
if [ -z "$RUNAS" ]
then
exec runuser -u demo "$@"
else
exec "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment