Skip to content
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

Maildata Volume #173

Closed
diiigle opened this issue May 1, 2016 · 11 comments
Closed

Maildata Volume #173

diiigle opened this issue May 1, 2016 · 11 comments

Comments

@diiigle
Copy link
Contributor

diiigle commented May 1, 2016

I do not get any data volume generated by the compose file. So i think the data is stored in the container locally.

Can you fix this, that the /var/mail folder is mapped to a secondary data volume container?

@tomav tomav added the question label May 2, 2016
@tomav
Copy link
Contributor

tomav commented May 3, 2016

@diiigle could you try this one:

version: '2'

services:
  mail:
    image: tvial/docker-mailserver:v2
    # build: .
    hostname: mail
    domainname: domain.com
    container_name: mail
    ports:
    - "25:25"
    - "143:143"
    - "587:587"
    - "993:993"
    volumes:
    - ./config/:/tmp/docker-mailserver/
    - maildata:/var/mail

volumes:
  maildata:
    driver: local

Let me know.

@diiigle
Copy link
Contributor Author

diiigle commented May 4, 2016

Nope, didn't worked. Still getting only one container 'mail' created.
From docker/compose#942 discussion:

I think we need the volumes_from command for the Data Volume Container.

aside question: how important is the hostname in this file? i set it to
the subdomain my mailserver is running on. Is that right?

@manthis
Copy link

manthis commented May 7, 2016

@diiigle you could also do like me and store your emails on your host file system:

version: '2'

services:
  mail:
    image: tvial/docker-mailserver:v2
    # build: .
    hostname: mail
    domainname: domain.com
    container_name: mail
    ports:
    - "25:25"
    - "143:143"
    - "587:587"
    - "993:993"
    volumes:
    - ./config/:/tmp/docker-mailserver/
    - ./maildata/:/var/mail

Feel free to change the path. I do actually store this folder on a USB key whose file system is encrypted ;)

@tomav
Copy link
Contributor

tomav commented May 7, 2016

@diiigle I have limited access to internet through my mobile phone, so I can't pull the image to test but try:

version: '2'

services:
  mail:
    image: tvial/docker-mailserver:v2
    # build: .
    hostname: mail
    domainname: domain.com
    container_name: mail
    ports:
    - "25:25"
    - "143:143"
    - "587:587"
    - "993:993"
    volumes:
    - ./config/:/tmp/docker-mailserver/
    - maildata:/var/mail
volumes:
 maildata:

@tomav
Copy link
Contributor

tomav commented May 7, 2016

Once this is resolved, I'll publish v2 as master version.

@tomav tomav added wip labels May 7, 2016
@manthis
Copy link

manthis commented May 7, 2016

Well I think what @diiigle would like is create a first volume container and then instantiate a docker-mailserver container using the volume from the first container. That's actually a good idea for backup purposes.

I guess it would be something like this to create the volume container:
docker create -v /var/mail --name datastore tvial/docker-mailserver:v2

And then this to use it:
docker run -d --volumes-from datastore --name mail tvial/docker-mailserver:v2

Is it closer to what you'd like @diiigle?

@manthis
Copy link

manthis commented May 7, 2016

Then of course you would only have to backup "datastore" container to secure your data.

@diiigle
Copy link
Contributor Author

diiigle commented May 7, 2016

@manthis yeah thats right, this would be the expected behaviour, since docker documentation advises you to store your data in data containers.

@tomav
Copy link
Contributor

tomav commented May 8, 2016

@diiigle tell me if the docker-compose templates works.
Seems ok for me.

root@mail:/# df
df: '/tmp/docker-mailserver': Function not implemented
Filesystem     1K-blocks    Used Available Use% Mounted on
none            28665468 3085312  24077360  12% /
tmpfs            1025520       0   1025520   0% /dev
tmpfs            1025520       0   1025520   0% /sys/fs/cgroup
/dev/vda1       28665468 3085312  24077360  12% /var/mail
shm                65536       0     65536   0% /dev/shm

@tomav
Copy link
Contributor

tomav commented May 8, 2016

@chris54721 pushed the same fix.

@tomav
Copy link
Contributor

tomav commented May 8, 2016

Merged.

@tomav tomav closed this as completed May 8, 2016
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

No branches or pull requests

3 participants