Skip to content

Conversation

@jeboehm
Copy link

@jeboehm jeboehm commented Jan 12, 2026

I'd like to suggest to remove both VOLUME directives from the non production build stages.
The VOLUME directive creates and mounts directories when creating a container. This is not always wanted, especially when using the image as a base.

See also:

Removed VOLUME directive for '/srv/mail' in both non production stages.
@schildbach
Copy link

schildbach commented Jan 12, 2026

I would rather not remove this, as it serves to persist the mail storage. Why would you not want to persist your mail?

You could base your image on the production-base target – it's without VOLUME.

@jeboehm
Copy link
Author

jeboehm commented Jan 12, 2026

Persistence itself is more or less established with volume mounts.
These are still possible in all container engines.

@schildbach
Copy link

The VOLUME declaration makes sure the volume is initialized with the right content and permissions.

@jeboehm
Copy link
Author

jeboehm commented Jan 12, 2026

The VOLUME declaration makes sure the volume is initialized with the right content and permissions.

What content?

I'd also like to point out that

mail_home = /srv/vmail/%{user | lower}
uses /srv/vmail as the path for mail storage, created in
mkdir /srv/vmail -p && \
.
For some reason /srv/mail is used as the home directory, which is IMHO unnecessary. /srv/vmail is also documented in the README.

I've solved these inconsistencies in 58d65c0. I still think that one VOLUME statement in the production layer is best for both users and developers, so I've kept this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants