ibm bluemix - Can I change owner of directory that is mounted on volume in IBM containers? -


i'm trying launch postgres in ibm containers. have created volume by:

$ cf ic volume create pgdata 

then mount it:

$ cf ic run --volume pgdata:/var/pgsql -p 22 registry.ng.bluemix.net/ruimo/pgsql944-cli 

after logging container through ssh, found mounted directory owned root:

drwxr-xr-x  3 root root   4096 jul  8 08:20 pgsql 

since postgres not permit run root, want change owner of directory. cannot change owner of directory:

# chown postgres:postgres pgsql chown: changing ownership of 'pgsql': permission denied 

is possible change owner of mounted directory?

in ibm containers, user namespace enabled docker engine. when, user namespace enabled, effective root inside container non-root user out side container process , nfs not allowing mapped non-root user perform chown operation on volume inside container. please note volume pgdata nfs, can verified executing mount -t nfs4 container.

you can try workaround suggested how can fix permissions using docker on bluemix volume?

in scenario be

1. mount volume `/mnt/pgdata` inside container  cf ic run --volume pgdata:/mnt/pgdata -p 22 registry.ng.bluemix.net/ruimo/pgsql944-cli  2. inside container  2.1 create "postgres" group , user     groupadd --gid 1010 postgres useradd --uid 1010 --gid 1010 -m --shell /bin/bash postgres  2.2 add user group "root" adduser postgres root chmod 775 /mnt/pgdata  2.3 create pgsql directory under bind-mount volume su -c "mkdir -p /mnt/pgdata/pgsql" postgres ln -sf /mnt/pgdata/pgsql /var/pgsql  2.2 remove user group "root" deluser postgres root chmod 755 /mnt/pgdata 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -