:: Re: [DNG] To docker or not to docke…
Top Page
Delete this message
Reply to this message
Author: Nick
Date:  
To: dng
Subject: Re: [DNG] To docker or not to docker?
On 18-12-2024 10:48, Alessandro Vesely via Dng wrote:
> Hi all,
>
> I happily arrived till here without ever using docker.  Now I'd want
> to install a package whose installation howto starts like so:
>
>     The easiest way to install Grist is as a container. We will describe
>     how using Docker, but there are many other tools and services for
>     running containers.
>
> Hm...
>
> I installed docker and tried to run it.  (I use -----begin---- and
> -----end----- markers for clarity.)
>
> -----begin-----
> ale@pcale:~$ docker run hello-world
> docker: permission denied while trying to connect to the Docker daemon
> socket at unix:///var/run/docker.sock: Post
> "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix
> /var/run/docker.sock: connect: permission denied.
> -----end-----
>
> Allright, then sudo:
>
> -----begin-----
> ale@pcale:~$ sudo docker run hello-world
> Unable to find image 'hello-world:latest' locally
> latest: Pulling from library/hello-world
> c1ec31eb5944: Pull complete
> Digest:
> sha256:5b3cc85e16e3058003c13b7821318369dad01dac3dbb877aac3c28182255c724
> Status: Downloaded newer image for hello-world:latest
>
> Hello from Docker!
> This message shows that your installation appears to be working
> correctly.
>
> To generate this message, Docker took the following steps:
>  1. The Docker client contacted the Docker daemon.
>  2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
>     (amd64)
>  3. The Docker daemon created a new container from that image which
> runs the
>     executable that produces the output you are currently reading.
>  4. The Docker daemon streamed that output to the Docker client, which
> sent it
>     to your terminal.
>
> To try something more ambitious, you can run an Ubuntu container with:
>  $ docker run -it ubuntu bash
>
> Share images, automate workflows, and more with a free Docker ID:
> https://hub.docker.com/
>
> For more examples and ideas, visit:
> https://docs.docker.com/get-started/
> -----end-----
>
> Compare that behavior with the following one:
>
> -----begin-----
> ale@pcale:~$ sudo pip3 install oletools
> error: externally-managed-environment
>
> × This environment is externally managed
> ╰─> To install Python packages system-wide, try apt install
>     python3-xyz, where xyz is the package you are trying to
>     install.
>
>     If you wish to install a non-Debian-packaged Python package,
>     create a virtual environment using python3 -m venv path/to/venv.
>     Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
>     sure you have python3-full installed.
>
>     If you wish to install a non-Debian packaged Python application,
>     it may be easiest to use pipx install xyz, which will manage a
>     virtual environment for you. Make sure you have pipx installed.
>
>     See /usr/share/doc/python3.11/README.venv for more information.
>
> note: If you believe this is a mistake, please contact your Python
> installation or OS distribution provider. You can override this, at
> the risk of breaking your Python installation or OS, by passing
> --break-system-packages.
> hint: See PEP 668 for the detailed specification.
> -----end-----
>
>
> Is someone using docker?  How do you prevent breaking the environment?
>
> Meanwhile, I'll look for methods to dedockerize grist.
>
>
> Best
> Ale



I use docker on a large scale but only with images i have build myself.
The error you show is a Python one.//Python's advise is to the use the
distro specific package in your case python3-olefile which you install
with apt.

Another available feature is that you can run docker rootless which is
very useful for most usecases. Only a fraction of the docker containers
need root to run.