Skip to content

Commit 74a10f2

Browse files
doc: dependencies and user privileges (#91)
<!-- Please use a PR title that conforms to *conventional commits*: "<commit_type>: Describe your change"; for example: "fix: prevent race condition". Some other commit types are: fix, feat, ci, doc, refactor... For a full list of commit types visit https://www.conventionalcommits.org/en/v1.0.0-beta.2/ --> #### Relevant issue or PR <!-- If the changes resolve an issue or follow some other PR, link to them here. Only link something if it is directly relevant. --> Closes #88. #### Description of changes <!-- Add a high-level description of changes, focusing on the *what* and *why*. --> - Added description of dependencies for users who installed Docker's CLI, rather than via Docker Desktop (which is only available for Windows and macOS, with limited support for some Linux distros). - Described steps to add user to the `docker` group, to avoid Tesseract OCR gotcha when using `sudo tesseract` #### Testing done <!-- Describe how the changes were tested; e.g., "CI passes", "Tested manually in stagingrepo#123", screenshots of a terminal session that verify the changes, or any other evidence of testing the changes. --> In progress. #### License - [X] By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license](https://pasteurlabs.github.io/tesseract/LICENSE). - [X] I sign the Developer Certificate of Origin below by adding my name and email address to the `Signed-off-by` line. <details> <summary><b>Developer Certificate of Origin</b></summary> ```text Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ``` </details> Signed-off-by: Jacan Chaplais jacan.chaplais@simulation.science --------- Co-authored-by: Dion Häfner <dion.haefner@simulation.science>
1 parent 24ea1bc commit 74a10f2

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

docs/content/introduction/installation.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Basic installation
44

55
```{note}
6-
Before proceeding, make sure you have a [working installation of Docker](https://docs.docker.com/engine/install/) and a modern Python installation (Python 3.10+), ideally in a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/).
6+
Before proceeding, make sure you have a working installation of Docker ([Docker Desktop](https://www.docker.com/products/docker-desktop/) or [Docker Engine](#installation-docker)) and a modern Python installation (Python 3.10+), ideally in a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/).
77
```
88

99
The simplest way to install Tesseract Core is via `pip`:
@@ -18,6 +18,29 @@ Then, verify everything is working as intended:
1818
$ tesseract list
1919
```
2020

21+
(installation-docker)=
22+
## Installing Docker
23+
24+
[Docker Desktop](https://www.docker.com/products/docker-desktop/) ships with everything you need to run Tesseract Core, including the Docker Engine CLI, Docker Compose, and Docker Buildx. It also includes a GUI for managing containers and images.
25+
It is available for Windows, macOS, and Linux for Debian and Fedora based distros.
26+
27+
If your system is not supported by Docker Desktop, or you prefer a more minimal setup, you will need to install the [`docker` engine CLI](https://docs.docker.com/engine/install/) together with some required plugins:
28+
29+
1. [`docker-buildx`](https://github.com/docker/buildx)
30+
2. [`docker-compose`](https://github.com/docker/compose)
31+
32+
To use Tesseract without `sudo`, you will need to add your user to the `docker` group. See [Linux post-installation steps for Docker Engine > Manage Docker as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user), or run:
33+
34+
```bash
35+
$ sudo usermod -aG docker $USER
36+
```
37+
38+
Then, log out and back in to apply the changes.
39+
40+
```{warning}
41+
Using `sudo tesseract` may bypass active virtual environments and shadow the `tesseract` command with [conflicting executables](#exe-conflicts). To avoid this, make sure you're using the correct `tesseract` executable, or add your user to the `docker` group (and omit `sudo`).
42+
```
43+
2144
(installation-runtime)=
2245
## Runtime installation
2346

@@ -38,6 +61,7 @@ Some shells use `[` and `]` as special characters, and might error out on the `p
3861

3962
Tesseract is fully supported on Windows via the Windows Subsystem for Linux (WSL). For guidance, please refer to the [official documentation](https://docs.microsoft.com/en-us/windows/wsl/).
4063

64+
(exe-conflicts)=
4165
### Conflicting executables
4266

4367
This is not the only software called "Tesseract". Sometimes, this leads to multiple executables with the same name, for example if you also have [Tesseract OCR](https://github.com/tesseract-ocr/tesseract) installed. In that case, you may encounter the following error:
@@ -62,6 +86,24 @@ You can always confirm what executable the command `tesseract` corresponds with
6286
$ which tesseract
6387
```
6488

89+
### Missing user privileges
90+
91+
If you lack permissions to access the Docker daemon, running e.g. `tesseract build` will result in the following exception:
92+
93+
```bash
94+
$ tesseract build examples/helloworld
95+
RuntimeError: Could not reach Docker daemon, check if it is running. See logs for details.
96+
```
97+
98+
You can resolve this by adding your user to the `docker` group.
99+
See [Linux post-installation steps for Docker Engine > Manage Docker as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user), or run:
100+
101+
```bash
102+
$ sudo usermod -aG docker $USER
103+
```
104+
105+
Then, log out and back in to apply the changes.
106+
65107
(installation-dev)=
66108
## Development installation
67109

0 commit comments

Comments
 (0)