This commit is contained in:
2024-01-21 15:45:45 +08:00
parent 33b475a3a0
commit e018df63e0
20 changed files with 923 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
---
slug: Dokcer Compose 遇到 Python 3.6 不再支援問題
title: Dokcer Compose 遇到 Python 3.6 不再支援問題
description:
toc: true
authors:
- awin
tags: []
categories: []
series: []
date: 2023-05-09T00:00:00
lastmod: 2023-05-09T00:00:00
featuredVideo:
featuredImage:
draft: false
enableComment: true
---
解決 `docker-compose` 警告 Python 3.6 不再支援問題。
<!--more-->
可能已經發生一時間了,但是最近才注意到 XD。
在使用 `docker-compose down` 或是 `docker-compose up`,都會出現下面這個訊息:
```bash
/snap/docker/2746/lib/python3.6/site-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography (40.0) will be the last to support Python 3.6.
from cryptography.hazmat.backends import default_backend
```
雖然已經確定使用 Python 3.10,查看 docker-compose 版本也確實發現它還是使用 Python 3.6
```bash
xxxx@xxxx:~/oooo/ooxx$ sudo docker-compose version
/snap/docker/2746/lib/python3.6/site-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography (40.0) will be the last to support Python 3.6.
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
```
這是因為 `docker-compose` 這個命令已經過時了,請改用 `docker compose` 就可以了。<br>
要是習慣改不過來不妨就加個alias吧
```bash
alias docker-compose='docker compose'
```