start work on dockerfile

Signed-off-by: Ben Yanke <ben@benyanke.com>
This commit is contained in:
Ben Yanke 2021-08-24 16:53:10 -05:00
parent 896ac98984
commit 769f7ce218
2 changed files with 42 additions and 0 deletions

40
Dockerfile Normal file
View File

@ -0,0 +1,40 @@
FROM python:3 as base
MAINTAINER Ben Yanke <benyanke@gmail.com>
##############
# Main setup stage
##############
# Copy in deps first, to improve build caching
COPY requirements.txt /app-src/requirements.txt
WORKDIR /app-src
# Get kerberos deps before pip deps can be fetched
#RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -qq -y krb5-user -y && rm -rf /var/lib/apt/lists/*
# Get latest pip and dependencies
RUN /usr/local/bin/python3 -m pip install --upgrade pip && pip install -r requirements.txt
# Copy in rest of the code after deps are in place
COPY . /app-src
# Install the app
RUN /usr/local/bin/python3 setup.py install
##############
# Run tests in a throwaway stage
# if tests are added later, run them here
##############
#FROM base as test
#WORKDIR /app-src
#RUN /usr/local/bin/python3 setup.py test
##############
# Throw away the test stage, revert back to base stage before push
##############
FROM base
WORKDIR /root
CMD ["/usr/local/bin/offlineimap"]
# reads from /root/.offlineimaprc by default - mount this in for running

View File

@ -67,6 +67,8 @@ If you are running Linux, you can install offlineimap with:
- openSUSE `zypper in offlineimap` - openSUSE `zypper in offlineimap`
- fedora `dnf install offlineimap` - fedora `dnf install offlineimap`
- Arch Linux: through AUR package [offlineimap3-git](https://aur.archlinux.org/packages/offlineimap3-git/) - Arch Linux: through AUR package [offlineimap3-git](https://aur.archlinux.org/packages/offlineimap3-git/)
- Docker image: `offlineimap/offlineimap:latest`
(note: image not published yet, just an example)
## Feedbacks and contributions ## Feedbacks and contributions