Files

45 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
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
---
可能已經發生一時間了,但是最近才注意到 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'
```