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

Add Dockerfile or instructions #45

Closed
isleshocky77 opened this issue Feb 7, 2019 · 2 comments
Closed

Add Dockerfile or instructions #45

isleshocky77 opened this issue Feb 7, 2019 · 2 comments

Comments

@isleshocky77
Copy link
Contributor

Any appetite for adding Dockerfile or at least documenting in the README? I had conflicts while loading this in my current system so decided to do it through docker instead.

Setup

$ mkdir -p /opt/import-mailbox-to-gmail
$ cd /opt/import-mailbox-to-gmail
$ git clone https://github.com/google/import-mailbox-to-gmail.git build

Create Dockerfile

# ./build/Dockerfile

FROM python:2

WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY import-mailbox-to-gmail.py .

ENTRYPOINT [ "python", "./import-mailbox-to-gmail.py" ]

Build

NOTE I had to add oauth2client to requirements.txt for it to work properly

$ cd ..
$ docker build -t import-mbox-to-gmail build/

Get Data

$ mkdir -p data/auth
$ cp ~/Downloads/mail-import-013546-135458687.json data/auth/ # Authentication file
$ mkdir -p data/mbox/user1@example.org
$ cp ~/Downloads/label-1.mbox data/mbox/user1@example.org/

Run

$ docker run --rm -it -v "$PWD/data:/data" \
       import-mbox-to-gmail \
          --json /data/auth/mail-import-013546-135458687.json \
          --dir /data/mbox
@eesheesh
Copy link
Collaborator

eesheesh commented Feb 7, 2019

Hi @isleshocky77, that's a great idea, thanks! A pull request will be welcome. :)

@isleshocky77
Copy link
Contributor Author

Closed by #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants