Skip to content

Commit 97bd7a6

Browse files
committed
Improve commands for container-based usage
1 parent 6362873 commit 97bd7a6

File tree

1 file changed

+49
-8
lines changed

1 file changed

+49
-8
lines changed

.github/README.md

+49-8
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,45 @@ we'll use `./my-data` here.
4646
If you have just one account, you can do as follows
4747

4848
```sh
49-
docker run -v ./my-data:/data -ti ghcr.io/joeyates/imap-backup:latest \
50-
imap-backup single backup \
49+
docker run \
50+
--volume ./my-data:/data \
5151
--dns 8.8.8.8 \
52-
--email me@example.com --password mysecret --server imap.example.com \
53-
--path /data/me_example.com
52+
ghcr.io/joeyates/imap-backup:latest \
53+
imap-backup single backup \
54+
--email me@example.com \
55+
--password mysecret \
56+
--server imap.example.com \
57+
--path /data/me_example.com
5458
```
5559

5660
Podman will work exactly the same.
5761

62+
Notes:
63+
64+
* If you're using Docker, add `--user $(id -u):$(id -g)` so that the files
65+
created by the container are owned by you and not by root,
66+
* Pass imap-backup the `--password-environment-variable=VARIABLE_NAME` or
67+
`--password-file=FILE` option to avoid having your password in
68+
the command line history:
69+
70+
```sh
71+
docker run --env THE_PASSWORD=$THE_PASSWORD \
72+
... \
73+
imap-backup single backup \
74+
--password-environment-variable=THE_PASSWORD \
75+
...
76+
```
77+
78+
or
79+
80+
```sh
81+
docker run \
82+
... \
83+
imap-backup single backup \
84+
--password-file=/data/password.txt \
85+
...
86+
```
87+
5888
If you have multiple accounts, you can create a configuration file.
5989

6090
You'll need to choose a path on your computer where your configuration will be saved,
@@ -63,16 +93,27 @@ we'll use `./my-config` here.
6393
First, run the menu-driven setup program to configure your accounts
6494

6595
```sh
66-
docker run -v ./my-config:/config -v ./my-data:/data -ti ghcr.io/joeyates/imap-backup:latest \
96+
docker run \
97+
--volume ./my-config:/config \
98+
--volume ./my-data:/data \
6799
--dns 8.8.8.8 \
68-
imap-backup setup -c /config/imap-backup.json
100+
--tty \
101+
--interactive \
102+
ghcr.io/joeyates/imap-backup:latest \
103+
imap-backup setup \
104+
--config /config/imap-backup.json
69105
```
70106

71107
Then, run the backup
72108

73109
```sh
74-
docker run -v ./my-config:/config -v ./my-data:/data --dns 8.8.8.8 -ti ghcr.io/joeyates/imap-backup:latest \
75-
imap-backup backup -c /config/imap-backup.json
110+
docker run \
111+
--volume ./my-config:/config \
112+
--volume ./my-data:/data \
113+
--dns 8.8.8.8 \
114+
ghcr.io/joeyates/imap-backup:latest \
115+
imap-backup backup \
116+
--config /config/imap-backup.json
76117
```
77118
</details>
78119

0 commit comments

Comments
 (0)