-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Enhancement: Add Docker Hub image #965
Enhancement: Add Docker Hub image #965
Conversation
i'll be pushing fixes, i'll drop a note when i think it is ready |
e77256f
to
46e74f3
Compare
Thanks for all your work so far! Why a "zip"? For example: When using zip all that information is lost. |
5f6dcde
to
db54a80
Compare
Sor
sorry, i don't really understand, which part of the code are you referering to? |
Yeah, nice work! Why use PHP 7.4 instead of 8.1 (or 8.2)?
I guess because the previous (actual) Dockerfile uses the ZIP file of Github release. Why make multiple |
yeah, i thought 7.4 was the minimum so i used it. 8.1 i heard has quite a bit faster according to benchmarks :) should we use it?
Oh i understand now. Yes
Yes, i should combine them. It was the purpose of better caching while i was working on those |
I'm building it on my own fork PR leojonathanoh#1 so when it pushes you guys can try to pull it. Check https://github.com/leojonathanoh/snappymail/pull/1/checks. Docker hub repo: https://hub.docker.com/r/leojonathanoh/snappymail # Latest build on PR
docker run --rm -it -p 8888:8888 leojonathanoh/snappymail:merge
# Or a specific build on PR
docker run --rm -it -p 8888:8888 leojonathanoh/snappymail:merge-<sha> |
Alright, it's pushed: docker run --rm -it -p 8888:8888 leojonathanoh/snappymail:merge |
i'll be testing with with actual email accounts. |
the image is a tad big, if anybody has any idea how to slim it down it would be nice 😄 |
Just a little update, from my general testing it works nicely. |
c748352
to
6fe8ae1
Compare
Great! You have any idea if this can be added/changed? The request is a docker without TLS. |
d9ac879
to
736ec9c
Compare
Reading the discussion, I understand the #873 OP's frustration because the current I suggest once the official Docker Hub image is built, to use it in the |
I've made the |
Thinking again, now I understand that the As for the examples for the reverse proxy, they should really go in |
4fdcbe9
to
35fc536
Compare
Ok i got most of the docs down, the main part is to need help validating the image works for various use cases e.g. gpg mails, contact sync, redis caching, etc which i know very little about. |
Just another update, i've tested Logs:
and screenshot: docker exec -it snappymail_snappymail_1 sh
/snappymail # find data/_data_/_default_/storage/
data/_data_/_default_/storage/
data/_data_/_default_/storage/example.com
data/_data_/_default_/storage/example.com/test
data/_data_/_default_/storage/example.com/test/settings_local
data/_data_/_default_/storage/example.com/test/additionalaccounts
data/_data_/_default_/storage/example.com/test/.sessions
data/_data_/_default_/storage/example.com/test/.sessions/cbe0274095a8c8f723aa2085e7a41b0e6172d3f4
data/_data_/_default_/storage/example.com/test/test2@example.com
data/_data_/_default_/storage/example.com/test/test2@example.com/settings_local
data/_data_/_default_/storage/example.com/test/test2@example.com/.files
data/_data_/_default_/storage/example.com/test/settings
data/_data_/_default_/storage/example.com/test/.gnupg
data/_data_/_default_/storage/example.com/test/.gnupg/S.gpg-agent.extra
data/_data_/_default_/storage/example.com/test/.gnupg/S.gpg-agent.browser
data/_data_/_default_/storage/example.com/test/.gnupg/trustdb.gpg
data/_data_/_default_/storage/example.com/test/.gnupg/private-keys-v1.d
data/_data_/_default_/storage/example.com/test/.gnupg/private-keys-v1.d/06B35D350E7397EC7499654530AB199EA829B3DC.key
data/_data_/_default_/storage/example.com/test/.gnupg/private-keys-v1.d/14DCEF524494613F82AAE2B3A870F89A0BF58368.key
data/_data_/_default_/storage/example.com/test/.gnupg/pubring.kbx
data/_data_/_default_/storage/example.com/test/.gnupg/S.gpg-agent
data/_data_/_default_/storage/example.com/test/.gnupg/S.gpg-agent.ssh
data/_data_/_default_/storage/example.com/test/.gnupg/pubring.kbx~
data/_data_/_default_/storage/__nobody__
data/_data_/_default_/storage/__nobody__/ec413e4e05ad76a7fd317512654eedb68a7df1db So i'm left with testing contact sync, with / without redis. |
files caching is working: $ docker exec -it snappymail_snappymail_1 sh
/snappymail # find data/_data_/_default_/cache/
data/_data_/_default_/cache/
data/_data_/_default_/cache/12
data/_data_/_default_/cache/12/0b
data/_data_/_default_/cache/12/0b/120b55b67752efb65c201664b25616fc09135f93
data/_data_/_default_/cache/23
data/_data_/_default_/cache/23/40
data/_data_/_default_/cache/23/40/2340061528ca14617684455305e76a4d20e8f251
data/_data_/_default_/cache/__
data/_data_/_default_/cache/__/te
data/_data_/_default_/cache/__/te/st
data/_data_/_default_/cache/__/te/st/test_example_com
data/_data_/_default_/cache/__/te/st/test_example_com/3e
data/_data_/_default_/cache/__/te/st/test_example_com/3e/24
data/_data_/_default_/cache/__/te/st/test_example_com/3e/24/3e24e6cf1fbe02b29f62df3a36bd437db9d630c4
data/_data_/_default_/cache/__/te/st/test_example_com/b6
data/_data_/_default_/cache/__/te/st/test_example_com/b6/0e
data/_data_/_default_/cache/__/te/st/test_example_com/b6/0e/b60e5eda410288314d6561b3573f92d48766030b
data/_data_/_default_/cache/__/te/st/test_example_com/b1
data/_data_/_default_/cache/__/te/st/test_example_com/b1/ec
data/_data_/_default_/cache/__/te/st/test_example_com/b1/ec/b1eca70046629cf090ff7baf6cd25d7ec2aec4b4
data/_data_/_default_/cache/__/te/st/test_example_com/e2
data/_data_/_default_/cache/__/te/st/test_example_com/e2/d4
data/_data_/_default_/cache/__/te/st/test_example_com/e2/d4/e2d44ccc3d72ae59fe8948e7aa957d8effbe5aa1
data/_data_/_default_/cache/__/te/st/test_example_com/32
data/_data_/_default_/cache/__/te/st/test_example_com/32/51
data/_data_/_default_/cache/__/te/st/test_example_com/32/51/325117d14e6c7b17d7f1afda5217ee16e831eaa7
data/_data_/_default_/cache/1d
data/_data_/_default_/cache/1d/23
data/_data_/_default_/cache/1d/23/1d232a7a0c458c0d3fa9945af5900f65a5f517c7
$ docker exec -it snappymail_redis_1 sh
/data # redis-cli
127.0.0.1:6379> scan 0
1) "0"
2) 1) "test_example_com/3e24e6cf1fbe02b29f62df3a36bd437db9d630c4"
2) "test_example_com/b1eca70046629cf090ff7baf6cd25d7ec2aec4b4"
3) "test_example_com/e2d44ccc3d72ae59fe8948e7aa957d8effbe5aa1"
4) "test_example_com/b60e5eda410288314d6561b3573f92d48766030b"
5) "test_example_com/325117d14e6c7b17d7f1afda5217ee16e831eaa7"
6) "120b55b67752efb65c201664b25616fc09135f93"
127.0.0.1:6379> get test_example_com/3e24e6cf1fbe02b29f62df3a36bd437db9d630c4
"{\"FolderHash\":\"9406bb65b795965f80f471315cc36c0b\",\"Uids\":[3,1]}"
127.0.0.1:6379> get test_example_com/b1eca70046629cf090ff7baf6cd25d7ec2aec4b4
"{\"FolderHash\":\"39825f5db43ada4d7f1b8941e66f7224\",\"Uids\":[5,4,3,2,1]}"
127.0.0.1:6379> get test_example_com/e2d44ccc3d72ae59fe8948e7aa957d8effbe5aa1
"{\"FolderHash\":\"d39d2a1d4cd45660bbb9bd11cccab931\",\"Uids\":[11,10,9,8,6,7,5,4,3,2,1]}"
127.0.0.1:6379> get test_example_com/b60e5eda410288314d6561b3573f92d48766030b
"{\"FolderHash\":\"69ac669d3ef5861a95c27a178c862f88\",\"Uids\":[3,2,1]}"
127.0.0.1:6379> get 120b55b67752efb65c201664b25616fc09135f93 with these config options:
|
I'm left wit hardening checks. |
0c32a05
to
5d574f8
Compare
ACLs lgtm:
|
I don't think we should combine the What's left is where the example |
Why is snappymail in root and not in something like Also the |
…and config file on the very first time
96c1052
to
f14a0cc
Compare
Honestly I'd just be elated if this would get merged already. |
Same thing. Can't wait to finally migrate from old rainloop image. |
Awesome :) Now we're just waiting for the arm64 version as well so it can run in Oracle cloud :) |
thank you ever so very much I'm going to try to schedule a talk about this with a local tech meeting group because I think this might be a turning point for usability of GPG |
Thank you for merging this 😄 Should another PR be opened for other archs? There were a few things left to do ... ? |
I had to modify a few things to get it all up and running. I do still have 1 main concern: persistent storage If everything works, we can do more archs but i think some things are missing, like PHP:
So check the |
Persistent storage is stored as a docker volume that the user should mount at About those extensions, I suppose you want all in that list to be included in the image? Shouldn't be too difficult, there's a good reference here. Thanks for all your work 😃 |
This pr breaks arm build. With 4daaa37 i can successfully build snappymail on my arm64 device via
After this pr, i build snappymail with log
|
@hibobmaster please try my arm64 image in #1321. This PR didn't break arm builds. |
@leojonathanoh Sorry for my late response. I successfully build arm image after digging into the action file, the build cmd is |
Summary
This builds on the already-existing "stale"
./docker/release
docker build context. As much as possible of the original docker image is retained, except for a few changes: 1) refactor to usealpine
as the base image 2) Instead of a customphp-cli
user, run asroot
andwww-data
, just like official docker hubnginx
andphp-fpm
images. 3) Removedlogrotate
andtail -f
sincesnappymail
logs go directly to/dev/stderr
instead oferror.log
4)auth.log
is preserved to be parsed by an externalfail2ban
container.Since I'm not an approved collaborator on this repo, the CI cannot run on this PR. So I'm building the image on the same branch on my fork PR leojonathanoh#1. Try it out:
Docker hub repo: https://hub.docker.com/r/leojonathanoh/snappymail
GitHub Container Registry: https://github.com/leojonathanoh/snappymail/pkgs/container/snappymail
Dockefile
:release.php
so it works to create a release.tar.gz
alpine
which will runsupervisord
,nginx
, andphp-fpm
. Allphp
extensions are preserved. Morephp
extensions may be added.php-cli
user in the image is removed. Instead of running all processes asphp-cli
user,supervisord
runs asroot
,nginx
master runs asroot
(like officialnginx
docker image),php-fpm
master process runs asroot
(like officialnginx
docker image)entrypoint.sh
:Dockerfile
toentrypoint.sh
. This allows users to be able to customize thephp-fpm
config via env vars.sed -z
since it's not posix-compatible.php-cli
user withroot
andwww-data
php-fpm.conf
:php-cli
user withroot
andwww-data
.supervisor.conf
:supervisord
runs asroot
nginx
now runs asroot
instead ofphp-cli
userphp-fpm
now runs asroot
instead ofphp-cli
userlogrotate
entry is removed, since logs in docker are redirected tostdout
/stderr
listener.php
now runs asroot
, so that it can killsupervisord
.github/workflows/ci.yml
:tags
,master
, as well as PRs currentlyProgress
TODO
.tar.gz
instead of.zip
php
extensionsphp
extensions:gnupg
ldap
pdo_mysql
pdo_pgsql
redis
,nginx
andphp-fpm
php-cli
user fromDockerfile
crond
invokeslogrotate
cronDockerfile
RUN
statements forphp
extensions to a single statementstdout
andstderr
viasupervisord
tags
(andmaster
?), with multi-arch builds.linux/386
andlinux/amd64
builds can be as fast as a few minutes, butlinux/arm64
builds can be as slow as 30 mins or more.linux/arm6
andlinux/arm7
builds are about 15-20mins i think.Settings > Actions > General > Actions permissions
, set toAllow all actions and reusable workflows
Settings > Actions > General > Fork pull request workflows from outside collaborators
DOCKERHUB_USERNAME
andDOCKERHUB_TOKEN
must be setup in the repo's secrets.Settings > Secrets and variables > Actions > Add repository secret
. I'll leave you to setup the DockerHub account./examples
. It's probably better named./docs
.image: leojonathanoh/snappymail
toimage: the-djmaze/snappymail
in examples.docker/release/files/usr/local/include/application.ini
(see Enhancement: Add Docker Hub image #965 (comment))TODO:
in the CI filesImplements #44