Why is /var/cache/nginx a volume? #19

Closed
dpwspoon opened this Issue Apr 14, 2015 · 7 comments

Comments

Projects
None yet
5 participants
@dpwspoon

I would like to know the reasoning on why /var/cache/nginx is a volume.

As an administrator of docker-nginx is this a folder I should archive by default?

@sherter

This comment has been minimized.

Show comment
Hide comment
@sherter

sherter Apr 14, 2015

Contributor

I guess this is just for better performance. By declaring an explicit volume you bypass docker's copy-on-write backend (e.g. aufs) and bind-mount the data directly from the host filesystem.
Images like mysql do this for the same reason.

Contributor

sherter commented Apr 14, 2015

I guess this is just for better performance. By declaring an explicit volume you bypass docker's copy-on-write backend (e.g. aufs) and bind-mount the data directly from the host filesystem.
Images like mysql do this for the same reason.

@thresheek

This comment has been minimized.

Show comment
Hide comment
@thresheek

thresheek Apr 14, 2015

Member

It is there so you could re-use caches (if any) between nginx upgrades.

Member

thresheek commented Apr 14, 2015

It is there so you could re-use caches (if any) between nginx upgrades.

@dpwspoon

This comment has been minimized.

Show comment
Hide comment
@dpwspoon

dpwspoon Apr 14, 2015

I discovered this when I was trying to learn docker and I noticed I was unintentionally orphaning docker volumes.

It seems to me that there are several files you may want to keep between updates such as the conf directories. I've found this issue on why for nginx most of those are not included in the volume.

Other then the potential performance reasons mentioned by @sherter, I can't see why the cache would be a special case. As such perhaps it may be better to remove it for consistency, or have it documented on docker hub/_/nginx readme so people don't make the mistake of orphaning volumes.

I discovered this when I was trying to learn docker and I noticed I was unintentionally orphaning docker volumes.

It seems to me that there are several files you may want to keep between updates such as the conf directories. I've found this issue on why for nginx most of those are not included in the volume.

Other then the potential performance reasons mentioned by @sherter, I can't see why the cache would be a special case. As such perhaps it may be better to remove it for consistency, or have it documented on docker hub/_/nginx readme so people don't make the mistake of orphaning volumes.

@booyaa

This comment has been minimized.

Show comment
Hide comment
@booyaa

booyaa Apr 16, 2015

isn't the cache used for static assets?

booyaa commented Apr 16, 2015

isn't the cache used for static assets?

@Siilwyn

This comment has been minimized.

Show comment
Hide comment
@Siilwyn

Siilwyn Aug 25, 2015

Other then the potential performance reasons mentioned by @sherter, I can't see why the cache would be a special case. As such perhaps it may be better to remove it for consistency, or have it documented on docker hub/_/nginx readme so people don't make the mistake of orphaning volumes.

I agree with this, at least document it in the readme.

Siilwyn commented Aug 25, 2015

Other then the potential performance reasons mentioned by @sherter, I can't see why the cache would be a special case. As such perhaps it may be better to remove it for consistency, or have it documented on docker hub/_/nginx readme so people don't make the mistake of orphaning volumes.

I agree with this, at least document it in the readme.

dpwspoon added a commit to dpwspoon/docker-nginx that referenced this issue Aug 25, 2015

@dpwspoon

This comment has been minimized.

Show comment
Hide comment
@dpwspoon

dpwspoon Aug 25, 2015

updated the dockerfile with the reasoning provided by @sherter via pull request

updated the dockerfile with the reasoning provided by @sherter via pull request

@md5 md5 referenced this issue in jwilder/nginx-proxy Sep 25, 2015

Closed

Can't get proxy_cache to work #241

@thresheek thresheek closed this in bb29d07 Jan 11, 2016

@Siilwyn

This comment has been minimized.

Show comment
Hide comment
@Siilwyn

Siilwyn Jan 11, 2016

👍 Nice!

Siilwyn commented Jan 11, 2016

👍 Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment