随笔 - 9,  文章 - 0,  评论 - 0,  阅读 - 3688

搭建

已经同时安装了 Docker Engine 和 Docker Compose

docker-compose version

docker-compose version 1.25.5, build 8a1c60f6
docker-py version: 4.1.0
CPython version: 3.7.5
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019

 

项目所需文件及内容参考官方文档(开始使用 Docker Compose |Docker 文档

  1. app.py

  2. Dockerfile

  3. docker-compose.yml
  4. requirements.txt

开始构建

docker-compose up

ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

原因:1.25的compose版本不支持3.9版本yml

solution:修改docker-compose.yml文件中版本号为3.3、修改后继续docker-compose up

 

 

ERROR: unable to select packages:
gcc (no such package):
required by: world[gcc]
linux-headers (no such package):
required by: world[linux-headers]
musl-dev (no such package):
required by: world[musl-dev]

ERROR: Service 'web' failed to build: The command '/bin/sh -c apk add --no-cache gcc musl-dev linux-headers' returned a non-zero code: 3

 

原因:新建容器如法联网

solution:用以下命令修改配置文件以启用ipv4转发

echo 1 > /proc/sys/net/ipv4/ip_forward

sysctl -w net.ipv4.ip_forward=1

sysctl -p /etc/sysctl.conf

 

WARNING: You are using pip version 21.2.4; however, version 22.1.2 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
ERROR: Service 'web' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 2

 

posted on   2191422302  阅读(945)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示