New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apache no rsync #1548
base: master
Are you sure you want to change the base?
Apache no rsync #1548
Conversation
@@ -121,8 +122,8 @@ RUN a2enmod headers rewrite remoteip ;\ | |||
} > /etc/apache2/conf-available/remoteip.conf;\ | |||
a2enconf remoteip | |||
|
|||
ENV NEXTCLOUD_VERSION 21.0.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using ARG
to be able to dynamically update the version without changing the Dockerfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARG
cannot be used in official images
&& mv /var/www/html/themes /usr/src/nextcloud/ \ | ||
&& mv /var/www/html/config /usr/src/nextcloud/ | ||
|
||
### Volumes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use a bunch of VOLUMES
to make explicit what directories need to be read/write.
In case they are not externally defined (see docker-compose.yml) they are going to contain what the container file-system has in that path up until that point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating a bunch of VOLUMES
is a bad practice. They are created on each run and there is no way to undefine them. You can create as many (read only) mounts as you need with --volume
.
COPY config/* /usr/src/nextcloud/config/ | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["apache2-foreground"] | ||
ENTRYPOINT [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make docker run
possible, I switch to CMD
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already possible due the exec "$@"
in the entypoint script.
Thanks for your contribution. This contains some relatively invasive changes. Some of them violates the best practice requirements for official images. If there is no strong reason for these changes it's unlikely that we'll merge them. |
@J0WI Can you point me to the violations so that I can mitigate them? |
As someone who lost a lot of time and effort when the rsync nuked the mount point where I copied my data from an old host, I'd love to see some activity on this. |
Some tweaks to the entrypoint and Dockerfile to not copy files that are tied to a version of nextcloud.
Instead use multiple volumes to hold r/w directories and make the rest of the container file-system r/o.
As discussed with @f7o
Start the Stack
First we start the database in the background
Afterwards starting the nextcloud:21.0.2 instance
Now we are able to open localhost:8000 and login as
administrator
/adminpass
Make some changes: added a user and some files.
We are going to stop the container (CTRL + C) and update to a new version.