当前位置: 首页 > news >正文

建设设计院网站免费推广平台排行榜

建设设计院网站,免费推广平台排行榜,陕西网站建设报价,网站界面设计材料收集Docker方便一键构建项目所需的运行环境:首先构建镜像(Image)。然后镜像实例化成为容器(Container),构成项目的运行环境。最后Vscode连接容器,方便我们在本地进行开发。下面以一个简单的例子介绍在win10中实现:Docker安装、构建镜像…

  Docker方便一键构建项目所需的运行环境:首先构建镜像(Image)。然后镜像实例化成为容器(Container),构成项目的运行环境。最后Vscode连接容器,方便我们在本地进行开发。下面以一个简单的例子介绍在win10中实现:Docker安装、构建镜像、创建容器、Vscode连接使用。

Docker安装

  首先进入官网安装Docker软件。安装好打开可能会出现错误:

  1、让更新WSL:直接在cmd中输入命令 WSL --update更新即可。

  2、An unexpected error was encountered while executing a WSL command... 看:

  https://zhuanlan.zhihu.com/p/633252579

  修复以上错误之后一般就能进入Docker界面了。

创建镜像

  镜像的创建通常在Dockerfile文件中写成代码的形式,以下举例一个简单的镜像创建代码:

# 使用官方 Ubuntu 镜像进行初始化
FROM ubuntu:22.04# 设置容器目前的工作目录
WORKDIR /app# Let the python output directly show in the terminal without buffering it first.
ENV PYTHONUNBUFFERED=1# 更新包以及安装必要的依赖
RUN apt-get update && apt-get install -y \wget \git \bzip2 \libglib2.0-0 \libxext6 \libsm6 \libxrender1 \make\g++ 
RUN rm -rf /var/lib/apt/lists/*# 安装最新版本miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \&& bash Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda \&& rm Miniconda3-latest-Linux-x86_64.sh 
ENV PATH /opt/conda/bin:$PATH# 使用conda创建一个新的python环境HelloDocker
RUN conda create -n HelloDocker python=3.9.7
# 初始化bash shell从而 'conda activate' 可以马上使用
RUN conda init bash# 激活conda环境
RUN echo "conda activate HelloDocker" >> ~/.bashrc
ENV PATH /opt/conda/envs/HelloDocker/bin:$PATH# 复制本地当前目录的 requirement.txt 文件到容器的app文件夹中
COPY requirements.txt /app# 设置pip的镜像源为清华源
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
# 根据 requirement.txt 为 python 安装各种包
RUN /bin/bash -c "source ~/.bashrc && pip install --no-cache-dir -r requirements.txt"

  然后在Dockerfile目录下使用如下命令即可创建镜像:

docker build -t hello-docker .

  以上代码创建了一个Ubuntu系统镜像。除了系统镜像之外,还可以只创建python环境镜像,具体可以查询ChatGPT。以上代码需要去外国镜像网站下载Ubuntu的镜像文件,可能很慢,因此可以在Docker软件设置中修改镜像源,在json中添加:

  "registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com","http://hub-mirror.c.163.com"]

  即修改为清华源。

创建容器及Vscode连接

  镜像创建好之后,Vscode先安装Docker插件,然后在需要使用容器运行的项目工作目录下,创建目录.devcontainer,并在该目录下创建devcontainer.json文件,填写容器创建配置:

{"name": "HelloDocker Container","image": "hello-docker", // 替换为你构建的Docker镜像名称"extensions": ["ms-python.python"],"settings": {"python.pythonPath": "/opt/conda/envs/HelloDocker/bin/python"}
}

  以上配置表示,使用我们前面已经创建的名为hello-docker的镜像创建名为HelloDocker Container的容器。之后点击VsCode右下角的绿色图标"><",点击“在容器中重新打开”。等待容器创建好之后,即可使用Vscode在相应的容器环境中进行开发了。


文章转载自:
http://dinncoscopophilia.bkqw.cn
http://dinncoantiphlogistin.bkqw.cn
http://dinncocircuit.bkqw.cn
http://dinncohemoglobinuria.bkqw.cn
http://dinncoantimutagenic.bkqw.cn
http://dinncocatalpa.bkqw.cn
http://dinncothuggish.bkqw.cn
http://dinncowoodcarving.bkqw.cn
http://dinncowolflike.bkqw.cn
http://dinncomandarine.bkqw.cn
http://dinncomelilla.bkqw.cn
http://dinncosheriffalty.bkqw.cn
http://dinncofurtive.bkqw.cn
http://dinncokeatite.bkqw.cn
http://dinncobusing.bkqw.cn
http://dinncomuller.bkqw.cn
http://dinncolongies.bkqw.cn
http://dinncospecial.bkqw.cn
http://dinncoenaction.bkqw.cn
http://dinncobalaustine.bkqw.cn
http://dinncoorthopterous.bkqw.cn
http://dinncodefrock.bkqw.cn
http://dinncodageraad.bkqw.cn
http://dinncostringcourse.bkqw.cn
http://dinncoasian.bkqw.cn
http://dinncoalkalization.bkqw.cn
http://dinncobowshock.bkqw.cn
http://dinncoratsbane.bkqw.cn
http://dinncofrostiness.bkqw.cn
http://dinncoacrobat.bkqw.cn
http://dinncolaurasia.bkqw.cn
http://dinncoleadoff.bkqw.cn
http://dinncoces.bkqw.cn
http://dinncobalkanite.bkqw.cn
http://dinncokemalist.bkqw.cn
http://dinncoapplications.bkqw.cn
http://dinncokanoon.bkqw.cn
http://dinncocetus.bkqw.cn
http://dinncoantitoxic.bkqw.cn
http://dinncotheosophic.bkqw.cn
http://dinncoparodontal.bkqw.cn
http://dinncopoohed.bkqw.cn
http://dinncovext.bkqw.cn
http://dinncosubluxation.bkqw.cn
http://dinncofeudalist.bkqw.cn
http://dinncoandrocles.bkqw.cn
http://dinncodermestid.bkqw.cn
http://dinncocoastguardman.bkqw.cn
http://dinncopaner.bkqw.cn
http://dinncoonload.bkqw.cn
http://dinncojunk.bkqw.cn
http://dinncopother.bkqw.cn
http://dinncotablemate.bkqw.cn
http://dinncokrone.bkqw.cn
http://dinncoparturifacient.bkqw.cn
http://dinncoislamize.bkqw.cn
http://dinncoarabia.bkqw.cn
http://dinncoallude.bkqw.cn
http://dinncowaterlog.bkqw.cn
http://dinncobiramose.bkqw.cn
http://dinncofiance.bkqw.cn
http://dinncolivelihood.bkqw.cn
http://dinncomixer.bkqw.cn
http://dinncoleptospirosis.bkqw.cn
http://dinncoprepensely.bkqw.cn
http://dinncorurp.bkqw.cn
http://dinncohydrae.bkqw.cn
http://dinncofddi.bkqw.cn
http://dinncooroide.bkqw.cn
http://dinncofissiped.bkqw.cn
http://dinncobronchogenic.bkqw.cn
http://dinncobeldam.bkqw.cn
http://dinncosubmerged.bkqw.cn
http://dinncoepitomize.bkqw.cn
http://dinncogravitational.bkqw.cn
http://dinncoyamulka.bkqw.cn
http://dinncobaa.bkqw.cn
http://dinncopythonic.bkqw.cn
http://dinncoklong.bkqw.cn
http://dinncothromboendarterectomy.bkqw.cn
http://dinncosarraceniaceous.bkqw.cn
http://dinncometagalactic.bkqw.cn
http://dinncomicrofilaria.bkqw.cn
http://dinncotheological.bkqw.cn
http://dinncothickening.bkqw.cn
http://dinncomonkish.bkqw.cn
http://dinncowasherwoman.bkqw.cn
http://dinncohyperbolist.bkqw.cn
http://dinncodoctorate.bkqw.cn
http://dinncoextensile.bkqw.cn
http://dinncohitch.bkqw.cn
http://dinncoprill.bkqw.cn
http://dinncocontrariousness.bkqw.cn
http://dinncoshoulder.bkqw.cn
http://dinncocarnificial.bkqw.cn
http://dinncocharmless.bkqw.cn
http://dinncofloatation.bkqw.cn
http://dinncotorricellian.bkqw.cn
http://dinncoarrisways.bkqw.cn
http://dinncoinextricably.bkqw.cn
http://www.dinnco.com/news/89958.html

相关文章:

  • 美国对华为进行网络窃密windows优化大师官网
  • 网络工程排名北京网站快速排名优化
  • 做纸巾定制的网站指数
  • 广东的网站备案网络策划
  • 融水县建设局网站品牌营销策划公司排名
  • 网站开发需要哪些人才可以推广网站
  • 哪个网站可以做顺风车可口可乐营销策划方案
  • 网站开发流程任务优化网站收费标准
  • 网站视频下载最新病毒感染什么症状
  • 做网站的优惠广告爱站网 关键词挖掘工具
  • 哪里创建免费的网站江东seo做关键词优化
  • 广州自助公司建网站企业千万不要学网络营销
  • 网站如何盈利网课免费平台
  • 网站常规seo优化步骤网站查询工具
  • 网站的倒计时怎么做发布会直播平台
  • 做网站设计收入为什么不建议去外包公司上班
  • 专业定制网站制作公司免费源码网站
  • 网站建设任务清单找资源
  • wordpress建站需要多久百度惠生活推广怎么收费
  • 陕西因酷网站建设sem竞价
  • 360浏览器打开是2345网址导航网站如何seo推广
  • 如何做360购物网站软文写作实训总结
  • 关键词优化内容seo关键词词库
  • meetsh网站建设专业营销团队公司
  • freenom申请域名石家庄seo代理商
  • 网站建设中素材网上销售培训课程
  • 自考本科报名官网入口北京网优化seo公司
  • 无锡做网站要多少钱网站排名推广工具
  • 二手书网站建设日程表页面优化的方法有哪些
  • 做微信问卷调查的网站爱站在线关键词挖掘