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

create docker builds for easy deployment #2

Open
3 tasks
pjstevns opened this issue Mar 12, 2019 · 4 comments
Open
3 tasks

create docker builds for easy deployment #2

pjstevns opened this issue Mar 12, 2019 · 4 comments

Comments

@pjstevns
Copy link
Member

pjstevns commented Mar 12, 2019

I would like the be able to use the smallest possible docker containers for deploying full-featured dbmail services in a docker swarm or k8s cluster.

I've started a docker branch, and have a poc working setup that still needs improvements:

  • static binaries, no additional packages
  • clear guidelines to ease deployments
  • possibily add ENVIRONMENT of key-store (aws-parameters, etc) support to dbmail.conf to avoid hard coding config values.
@pjstevns pjstevns added this to In progress in dbmail-3.3 Mar 16, 2019
@pjstevns
Copy link
Member Author

Some updates:

  • static binaries is a no-go. They are not really static after all, they just link the modules statically, not the required libraries (i.e. glib, gmime, zdb, mhash)
  • running a daemon inside the container segfaults when running in stdin/out mode (-n). Network mode seems to work just fine (-D)
  • the resulting images is now < 30MB, which is pretty nice!

@kak-tus
Copy link

kak-tus commented Apr 12, 2019

Please, add this image as automated build at Docker Hub (with tags). It is simple.

I created and used image with dbmail for two years, but it is much bigger, than this alpine based.
https://hub.docker.com/r/kaktuss/dbmail

Also some notes to image:

  1. It is better to declare not sh CMD to start some of dbmail binaries. May be with env variable (see example at my image) or may be with dedicated images for every binary.
  2. It is better to start binaries as non privileged user. Something like this
RUN \
  adduser -DH user

USER user
CMD ...
  1. I also had a problem with "-n" mode, but fixed it with running in "-D" mode and watching for pid
    https://github.com/kak-tus/docker-dbmail/blob/master/dbmail_start.sh#L24

@phozzy
Copy link

phozzy commented Apr 29, 2019

* static binaries is a no-go. They are not really static after all, they just link the modules statically, not the required libraries (i.e. glib, gmime, zdb, mhash)

-- that is actually ok. according to 12factorApp dependecies it is fine while you have explicit dependency specification.

* running a daemon inside the container segfaults when running in stdin/out mode (-n). Network mode seems to work just fine (-D)

-- sorry guys, I am not aware about dbmail internals, so I don't know how is it possible to run dbmail. But according to Configure app as PID 1 your application should run as PID1 inside a container, so not like a daemon.

* possibily add ENVIRONMENT of key-store (aws-parameters, etc) support to dbmail.conf to avoid hard coding config values.

-- according to 12factor App config it is strict requirement.

Just to mention :-)

CozC added a commit that referenced this issue Apr 2, 2020
According to RFC7162 section 3.1.3.0 MODIFIED keyword should be used
CozC pushed a commit that referenced this issue Apr 2, 2020
@hemml
Copy link
Contributor

hemml commented Jun 4, 2022

I'm not sure it will be helpful here, but this is a script, which I'm using to build a deb package of latest dbmail:

docker rm dbmail-build
docker run --name dbmail-build debian:buster /bin/sh -c '
  apt-get update &&\
  apt-get -y dist-upgrade &&\
  apt-get -y install git automake automake1.11 autoconf debhelper\
          libncurses5-dev libldap2-dev libtool asciidoc xmlto po-debconf\
          default-libmysqlclient-dev libpq-dev libsqlite3-dev libsieve2-dev\
          libglib2.0-dev libgmime-2.6-dev libzdb-dev libmhash-dev libevent-dev\
          pkg-config libssl-dev cdbs libgmime-3.0-dev &&\
  mkdir /build-dir &&\
  cd /build-dir &&\
  git clone https://github.com/dbmail/dbmail.git &&\
  cd dbmail &&\
  dpkg-buildpackage -us -uc -d &&\
  cd /build-dir &&
  tar -cvf /dbmail.tar dbmail_*.deb' &&
docker cp dbmail-build:/dbmail.tar ./ &&
tar -xvf dbmail.tar &&
rm dbmail.tar &&
docker rm dbmail-build

(inspired by the instruction found here: http://innerlife.io/ru/dbmail-postgresql-postfix-sasl-debian-part2-2/)

alan-hicks added a commit that referenced this issue Sep 7, 2023
Merge from dbmail/main
alan-hicks added a commit that referenced this issue Sep 28, 2023
DBMail deployments made easier with docker compose #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
dbmail-3.3
  
In progress
Development

No branches or pull requests

4 participants