docker icon indicating copy to clipboard operation
docker copied to clipboard

How to switch to alpine images ?

Open pgera opened this issue 6 years ago • 5 comments

I have been using the docker compose files satisfactorily for a while. I noticed that this commit https://github.com/nextcloud/docker/commit/aa5c0c192995e98836fc3c5435119583a78bef62 changes the images to alpine variants and removes the www-data user from nginx.conf. I tried to pull in these changes, but got a bunch of permission errors in the nginx log, presumably due to the difference in www-data ? My questions are:

  1. Do I need to pull in these changes ? i.e., Would the original images (and their combination) be maintained for nextcloud ?
  2. If it is advisable to change, what is the migration path ? I was reluctant to perturb a working config.

pgera avatar Jan 11 '19 10:01 pgera

alpine has different User IDs for the user www-data. This means, that if you switch to the alpine image, the owner and permissions of the directory /var/www are incorrect. You need to execute the following command manually to correct this: docker exec nextcloud_app_1 chown -R www-data:root /var/www (replace "nextcloud_app_1" with your actual app container) After that, restart the container and the permission errors should disappear.

Make sure that you have the most current "nginx.conf" for your alpine image, otherwise your container will not start with an error... (the first line should NOT be user www-data;!)

fuse314 avatar Jan 11 '19 15:01 fuse314

Thank you! This worked. Perhaps this should be added as documentation somewhere.

pgera avatar Jan 11 '19 22:01 pgera

@pera could you write down your steps and submit a pr?

SnowMB avatar Jan 29 '19 09:01 SnowMB

The steps are exactly the same as https://github.com/nextcloud/docker/issues/601#issuecomment-453552857. I can submit a pr, but I don't know where this sort of documentation goes. There isn't an explicit category for this sort of thing. Maybe a new category with important breaking changes should be created where breaking is defined as anything that breaks if you do a git pull in your local install.

pgera avatar Mar 11 '19 07:03 pgera

The since added Migrating an existing installation section could probably hold this info under a sub-section.

joshtrichards avatar Sep 10 '23 21:09 joshtrichards