Louis
Louis

Reputation: 321

Dockerize a python application for distribution

I created a small python application that automatically sends emails with some customization.

I want to distribute it in a way that is fairly easy for end users (i.e., general Windows and macOS users) to download and use.

I thought of bundling the app as a docker image, but I am running in technical problems.

The main one is that I rely on the yagmail library, which itself relies on the keyring library. It works great outside of docker, but within docker it’s a different story.

It requires a keyring backend that is usually installed by default on platforms. However, within the docker container, there is no keyring backend.

  1. I struggle to install a backend keyring in the docker without making a multi-GB image.

  2. Even once installed, it seems quite of a hassle if the end users have to re-enter their app specific password (as google requires it) again and again, every time they want to use the app. (I mean when they close/remove the docker container as they have no use for it during a week or so, and then relaunch it having to re-enter an app specific password.)

More broadly, I know docker would probably make it simpler for me to distribute the app to different platforms, but I wonder if for the end user it is the easiest to download/use the application. I’d like your take on it.

Here is my dockerfile for reference:

FROM python:3.10

WORKDIR /app

# RUN apt update -y && apt-get install -y kwalletmanager # This did not work

RUN pip3 install --no-cache-dir yagmail[all]

COPY iteramail.py .

CMD ["python3", "iteramail.py", "--help", "run", "--host=0.0.0.0"]

Upvotes: 0

Views: 485

Answers (0)

Related Questions