windows开发环境,一篇文章搞定
Scoop–包管理工具
使用过Linux发行版或MacOs的小伙伴们,相比对包管理概念不会陌生
而对于windows而言,庞杂,开放的软件生态使得大家的软件散落在各处,难以管理
scoop,windows系统的程序员之光,超好用的包管理工具,你值得拥有
利用scoop来管理你的软件,最大的好处就是它会自动设置环境变量并管理环境依赖
scoop 官方wiki
scoop 官方安装教程
## 更新powershell执行策略
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
## 执行脚本下载并安装scoop
iwr -useb get.scoop.sh | iex
## 以git为例
scoop install git
## 以git为例
scoop uninstall git
PS C:\Users\15051> scoop search git
'main' bucket:git-annex (8.20200226)git-chglog (0.9.1)git-crypt (0.6.0-701fb8e)git-filter-repo (2.25.0)git-interactive-rebase-tool (1.2.1)git-istage (0.2.61)git-lfs (2.10.0)git-sizer (1.3.0)git-tfs (0.30)git-town (7.3.0)git-up (1.6.1)git-with-openssh (2.25.1.windows.1)git (2.25.1.windows.1)gitea (1.11.1)gitignore (0.2018.07.25)gitkube (0.3.0)gitlab-runner (12.8.0)gitomatic (0.2)gitversion (5.1.3)llvm (9.0.0) --> includes 'git-clang-format'mingit-busybox (2.25.1.windows.1)mingit (2.25.1.windows.1)psgithub (2017.01.22)psutils (0.2020.02.27) --> includes 'gitignore.ps1'
-
scoop中的bucket
- scoop官方维护的buket(‘mian’ bucket – 相当于软件仓库)有非常严格的收录要求
- 例如不收录带有GUI的软件等
- 因此当需要下载带有GUI的软件时,往往需要安装额外的bucket。
- 以我们最常用的ide软件jetbrains的idea为例
PS C:\Users\15051> scoop search idea
Results from other known buckets...
(add them using 'scoop bucket add ' )'extras' bucket:bucket/grideabucket/idea-eapbucket/idea-ultimate-eapbucket/idea-ultimatebucket/idea'jetbrains' bucket:bucket/IntelliJ-IDEA-EAP-portablebucket/IntelliJ-IDEA-EAPbucket/IntelliJ-IDEA-Education-EAP-portablebucket/IntelliJ-IDEA-Education-EAPbucket/IntelliJ-IDEA-Education-portablebucket/IntelliJ-IDEA-Educationbucket/IntelliJ-IDEA-RC-portablebucket/IntelliJ-IDEA-RCbucket/IntelliJ-IDEA-Ultimate-EAP-portablebucket/IntelliJ-IDEA-Ultimate-EAPbucket/IntelliJ-IDEA-Ultimate-RC-portablebucket/IntelliJ-IDEA-Ultimate-RCbucket/IntelliJ-IDEA-Ultimate-portablebucket/IntelliJ-IDEA-Ultimatebucket/IntelliJ-IDEA-portablebucket/IntelliJ-IDEA
- 可以发现收录idea的bucket为’extras’ bucket和’jetbrains’ bucket**
- 因此在利用scoop安装idea之前需要添加仓库**
PS C:\Users\15051> scoop bucket add jetbrains
Checking repo... ok
The jetbrains bucket was added successfully.
- 之后就可以安装一些主仓库中未收录的软件,如idea
scoop install IntelliJ-IDEA-Ultimate
scoop的home功能非常的有意思,当想去某个软件的官网查看一些东西时,直接使用scoop home使得默认浏览器跳转到软件的官方界面,这绝对比在浏览器中输入搜查再跳转要更快一些
## 以git为例
scoop home git
Some useful commands are:alias Manage scoop aliases
bucket Manage Scoop buckets
cache Show or clear the download cache
checkup Check for potential problems
cleanup Cleanup apps by removing old versions
config Get or set configuration values
create Create a custom app manifest
depends List dependencies for an app
export Exports (an importable) list of installed apps
help Show help for a command
hold Hold an app to disable updates
home Opens the app homepage
info Display information about an app
install Install apps
list List installed apps
prefix Returns the path to the specified app
reset Reset an app to resolve conflicts
search Search available apps
status Show status and check for new app versions
unhold Unhold an app to enable updates
uninstall Uninstall an app
update Update apps, or Scoop itself
virustotal Look for apps hash on virustotal.com
which Locate a shim/executable (similar to 'which' on Linux)
docker for windows
在微服务大行其道的当下,各种中间件伴随着我们开发的日常
例如在我之前工作的公司,本地项目的启动,往往需要通过Bash文件先启动三四个中间件的服务,本地项目才能正确的启动
另一方面,需要进行详细配置或带有数据的服务,在换一台电脑进行开发时,往往需要重复又一遍的配置,想到曾经公司内网出问题的一段时间,本地装一个Oracle数据库,从下载安装到创建表空间到导入数据脚本,该踩的坑一个没落,一套操作下来,之前代码写到哪里又忘的差不多了
这时,如果我有一个制作好的数据库镜像,那么,一行命令,你就可以重新进入开发的状态
-
安装之前
- 64位Windows 10 Pro,专业版、企业版和教育版
- bios中开启虚拟化
- 查看是否开启虚拟化
- Windows10启用Hyper-v
-
下载安装
- docker for windows下载地址,建议使用迅雷下载,点击Get Docker,将跳转的链接复制到迅雷即可

- 傻瓜式安装,一直点击下一步就ok了,其中使用winodws虚拟化的选项不要点,当然点了也可以在安装完成之后切换回Linux
- docker for windows下载地址,建议使用迅雷下载,点击Get Docker,将跳转的链接复制到迅雷即可
-
更改镜像源
- 由于众所周知的原因,从官方镜像仓库中拉取镜像会非常慢,更改镜像源便是我们安装完成之后的第一步
- 截图中镜像源为阿里云的,需要登录后去申请,Docker国内镜像源,可以随便选择一个使用

-
检验安装
PS C:\Users\Y> docker -v
Docker version 19.03.5, build 633a0ea
-
使用Docker
- 容器及虚拟化技术,确实是一门非常大的学问,值得深刻的钻研一下,这里只能推荐一下文档或是教程
- 一来俺也是个还未入门的菜鸡,想要教别人如何使用容器技术未免贻笑大方
- 二来关于容器的知识浩如烟海,但是对于一个开发人员来说,确实是学有余力的事情
- Docker资料,超齐全,可以做查阅用,一边学习概念一边查阅命令
- 超棒的Docker课程,开源免费,那还等什么,快去学
- 入门的Docker练习,学习之余不要忘记好好训练
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
