My Ubuntu server runs docker installed with snap. Recently I noticed that running docker-compose
brings up a Python related warning, for example:
$ docker-compose version
/snap/docker/2285/lib/python3.6/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
from cryptography.hazmat.backends import default_backend
docker-compose version 1.29.2, build unknown
docker-py version: 5.0.3
CPython version: 3.6.9
OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
My Python version is higher:
$ python3 --version
Python 3.10.6
And:
$ docker version
Client:
Version: 20.10.17
API version: 1.41
Go version: go1.16.15
Git commit: 100c70180f
Built: Thu Sep 22 06:21:41 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.16.15
Git commit: a89b842
Built: Thu Sep 22 06:22:13 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.6.6
GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
runc:
Version: 1.1.2
GitCommit:
docker-init:
Version: 0.19.0
GitCommit: de40ad0
I saw a comment on a GitHub issue about using pip
to reinstall docker-compose
but I don't think that would help here since I didn't install it with pip
:
$ pip3 list
Command 'pip3' not found, but can be installed with:
sudo apt install python3-pip
$ pip list
Command 'pip' not found, but can be installed with:
sudo apt install python3-pip
As far as I know, the docker-compose
plugin is included with the docker snap. For now I just shut it up with:
alias docker-compose="docker-compose 2>/dev/null"
But this can hide other errors and I'd prefer an actual fix. Would appreciate any ideas.