-
Notifications
You must be signed in to change notification settings - Fork 99
Update Docker setup #409
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
Update Docker setup #409
Conversation
|
I love the GitHub Actions workflows! I'm not sure trunk=stable? @mguessan, can you comment on that? I would suggest adding a manual option to at least the stable workflow. It would be nice to have a workflow for publishing a specific version and Does the Dockerfile need to be in the root of the repository for the GitHub Actions workflows to work? Otherwise, I'd would prefer to keep it in And as someone who routinely uses Makefiles to build my Docker images, I think there's still some value in keeping a Makefile around in |
Yes this is possible! Will push commit in a bit
I does not need to. Generally speaking most projects keep the
Honestly, I have never used the Makefile that was there (and I have no idea how to use it). However, the Dockerfile builds davmail based on the files in the current directory. Building: Running (with Running (with native I'm not sure how to properly setup the Makefile for this, let me know how you imagine it |
Yes, that's how @mguessan does new releases (by adding a tag with the new version number). The last release was 6.3.0.
Well, it's up to @mguessan, of course, but the focus of this repository traditionally hasn't been to build a Docker image, so it doesn't necessarily make sense to put those files in the top level like in some other repos. I do recommend mentioning the existence of the
I suggest looking at https://github.com/mguessan/davmail/blob/master/src/contribs/docker/Makefile, but that employs a somewhat complicated image building mechanism. The Makefiles I use for building Docker images tend to be much simpler. I usually do something simple like this: IMAGE_NAME = mguessan/davmail
IMAGE_VERSION ?= ""
ifeq ($(IMAGE_VERSION),)
IMAGE_LABEL ?= $(IMAGE_NAME)
else
IMAGE_LABEL ?= $(IMAGE_NAME):${IMAGE_VERSION}
endif
image:
@echo "Building Docker image ${IMAGE_LABEL}..."
docker build -t $(IMAGE_LABEL) .
tag-latest-without-build:
@echo "Tagging Docker image ${IMAGE_LABEL} with latest..."
docker tag `docker image ls --format '{{.ID}}' $(IMAGE_LABEL)` $(IMAGE_NAME):latest
latest: image tag-latest-without-buildAnd you're probably thinking that that's so simple that it's unnecessary, which it might very well be, but I find it more convenient to type I wonder if the current Docker files should be retained in a |
|
A lot of interesting stuff in there, I feel like the existing contribs goal is to run DavMail in desktop mode, this new PR is more oriented towards server mode (see letsencrypt / traefik instructions). We may want to mention the |
|
Okay, I'll take a look tomorrow to get this PR merged. Just to confirm I am not missing anything, the only changes needed are:
|
I would still advise retaining and moving the existing |
|
Okay, let me know if something else should be changed! |
|
|
||
| ### Docker | ||
|
|
||
| To run davmail in docker, please read [src/contribs/docker/README.md](https://github.com/mguessan/davmail/blob/master/src/contribs/docker/README.md) |
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.
Nitpick: Change "davmail in docker" to "DavMail in a Docker container".
Other than this minor change, everything looks good to me. 😄
git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@3794 3d1905a2-6b24-0410-a738-b14d5a86fcbd
|
I started working on merging this contribution:
I managed to push a first version of the package to Github, however workflow is not yet in place, need to make sure it's stable first. In addition I had some trouble to make the interactive part work, in wayland docker apps can't connect to X11 display, however even back to X11 it's still not stable Last point: DavMail is unable to access /config volume, need to investigate |
|
I use X11 and have very little experience using Wayland, but I think this is how to run a Wayland client inside a Docker container: Oh, the desktop OS you are using and the OS in the Docker container both need to be configured to use Wayland. |
|
@mguessan wrote:
The docker command in the Makefile includes the arguments |
git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@3809 3d1905a2-6b24-0410-a738-b14d5a86fcbd
|
Github workflows merged, had to grant actions access to packages and also make package public (by default it was private). BTW found the root cause to my volume access issues: selinux was enabled on VM ! |
I run into that all the time at work myself! |
This is pretty awesome! One minor thing of no consequence that you might want to tweak:
Change "unstable" there to "release image". Also, I think some mention of the Docker images should be mentioned in the top-level README.md. The PR had such a change. What's the full Docker registry path to pull the Docker images tagged by the GitHub Actions workflows? |
Tags can be found here: https://github.com/mguessan/davmail/pkgs/container/davmail |
|
Ok I applied a lot of adjustments from testing feedback. Main changes are a new DAVMAIL_PROPERTIES environment variable set by default to /config/davmail.properties The /config volume is mounted from ~/.davmail, need to make sure this directory exists before first docker run to avoid it getting root ownership. The template file is created in /etc inside docker image and copied to /config only if there is no existing configuration. SWT browser does not work inside Docker so we prefer OpenJFX embedded browser. Added a link to Docker images on home page README This should be relatively stable now, will close this PR soon, we can always create new tickets for new issues. |
|
Closing PR, all changes should be merged in trunk. Thanks for this awesome contribution. |
Hello 👋
I have updated the docker setup such that allows for automatically building and publishing to the github container registry. This way, people can easily download the docker image without building it themselves (similar to just downloading the latest release from sourceforge).
I have also added a compose file for ease of use, so people can you do
docker compose up -dand boom, they have davmail running.In addition, I have also explained how to setup SSL (both using letsencrypt and traefik) and how to use an interactive method even when running davmail on a headless server.
Let me know if you have any thoughts!