Skip to content

Container fails to start when NFS-backed volume is mounted at /var/www/html #137

@lmsurpre

Description

@lmsurpre

I am trying to run this image on the IBM Containers service, but unfortunately when I map a volume to /var/www/html, it fails to start with the following errors:

WordPress not found in /var/www/html - copying now...
tar: ./wp-content/index.php: Cannot change ownership to uid 33, gid 33: Permission denied
tar: ./wp-content/plugins/akismet/readme.txt: Cannot change ownership to uid 33, gid 33: Permission denied
tar: ./wp-content/plugins/akismet/LICENSE.txt: Cannot change ownership to uid 33, gid 33: Permission denied
tar: ./wp-content/plugins/akismet/index.php: Cannot change ownership to uid 33, gid 33: Permission denied
tar: ./wp-content/plugins/akismet/wrapper.php: Cannot change ownership to uid 33, gid 33: Permission denied
...

After poking around, it looks like there is currently a limitation with the use of NFS-backed volumes which prevents the changing of file owners: https://console.ng.bluemix.net/docs/containers/container_troubleshoot.html#ts_vol_owner

As a workaround, I have wrapped this image with my own dockerfile that

  1. adds the www-data user to the root group; and
  2. grants group write access to /var/www/html

Happy to receive feedback on that approach, as well as any other ideas for working around this limitation.
Are there simple changes that could be made to the official image to make it work in this type of environment?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions