栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

ubuntu docker安装部署(docker安装部署)

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ubuntu docker安装部署(docker安装部署)

指导思想:从【安装镜像】转变为【进入容器内部直接安装包】

大佬说:“就用你现有的镜像作为基础,在里面安装uwsgi就好了。你可以把它当作你的django开发环境。”
指导过程见链接https://blog.csdn.net/m0_46629123/article/details/122922538

重要指令: docker ps
C:Windowssystem32>docker ps
(查看docker正在运行的容器)
docker exec -it < container > /bin/bash
C:Windowssystem32>docker exec -it pp_container4_slim /bin/bash
(进入容器内部)
pip
C:Windowssystem32>docker exec -it pp_container4_slim /bin/bash
(进入容器内部)

root@973528a8ae49:/code/package# pip
(查看容器内部的pip命令)

pip install uwsgi(可能会报错)

安装指令pip install uwsgi

root@973528a8ae49:/code/package# pip install uwsgi
(pip安装uwsgi)

出错信息

  AttributeError: 'NoneType' object has no attribute 'split'
(windows系统/linux插件不全时下会报错)
  Exception: you need a C compiler to build uWSGI
(建uWSGI需要C compiler)

大佬说需要安装GCC(yum install gcc) yum install gcc(过程有可能会出错)

安装指令yum install gcc

root@973528a8ae49:/code/package# yum install gcc
(安装gcc)
bash: yum: command not found
(未安装yum)

获取linux版本

root@973528a8ae49:/code/package# cat /proc/version
(获取linux版本)
Linux version 5.10.16.3-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Apr 2 22:23:49 UTC 2021

uname -a命令用于显示系统信息

root@973528a8ae49:/code/package# uname -a
(Linux uname(英文全拼:unix name)命令用于显示系统信息。)
Linux 973528a8ae49 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 GNU/Linux

apt-get update更新软件列表
https://blog.csdn.net/qq_40563761/article/details/84107480

root@973528a8ae49:/code/package# apt-get update
(更新软件列表https://blog.csdn.net/qq_40563761/article/details/84107480)
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Get:4 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [118 kB]
Get:5 http://deb.debian.org/debian bullseye/main amd64 Packages [8183 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [2596 B]
Fetched 8503 kB in 7s (1212 kB/s)
Reading package lists... Done

apt-get install gcc 来安装gcc

root@973528a8ae49:/code/package# apt-get install gcc
(gcc安装)
......
此处略过一万字
......
pip install uwsgi未报错的界面
root@973528a8ae49:/code/package# pip install uwsgi
(安装uwsgi)
Collecting uwsgi
  Using cached uwsgi-2.0.20.tar.gz (804 kB)
Building wheels for collected packages: uwsgi
  Building wheel for uwsgi (setup.py) ... done
  Created wheel for uwsgi: filename=uWSGI-2.0.20-cp38-cp38-linux_x86_64.whl size=510248 sha256=9be4add8f0457318596920a5b66f7c5f00b0996a47a9f871a7cfa97b6fc2581b
  Stored in directory: /root/.cache/pip/wheels/cb/4d/54/002a215100a8c4e125654600f0a4304dae742442ddc4ba6ea1
Successfully built uwsgi
Installing collected packages: uwsgi
Successfully installed uwsgi-2.0.20

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/772827.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号