加速 Elixir 开发环境
最编程
2024-02-23 20:22:03
...
Elixir 应用构建拉依赖经常需要走外网,但 GitHub 默认创建的 Codespaces 环境默认一般都是 js 的开发环境 Dockerfile,并没有 Elixir 环境,需要我们自己单独配置一手,好在提供了 devcontainer 的形式供我们自定义自己的基础开发环境,我们只需要提供配置文件就好, 我们需要做的如下:
- 1、GitHub 仓库创建
.devcontainer
目录; - 2、
.devcontainer
下的devcontainer.json
文件声明开发环境配置;
示范仓库如: https://github.com/yeshan333/erlang_elixir_asdf_ubuntu_container/tree/main/.devcontainer
{
"image": "ghcr.io/yeshan333/erlang_elixir_asdf_ubuntu_container:latest",
"customizations": {
"vscode": {
"extensions": ["jakebecker.elixir-ls"]
}
},
"postCreateCommand": "git config --global core.fileMode false"
}
通过 image 字段,我们直接声明了 GitHub Codespaces 使用的 Docker 镜像,extensions 指定了要启用哪些 vscode 插件,postCreateCommand 制定了环境起来之后要跑的 shell 命令。甚至于也可以指定我们自己写的 Dockerfile 来启动 GitHub Codespaces 环境,可参考:https://github.com/devcontainers/images/blob/main/src/go/.devcontainer/devcontainer.json。
基于以上,我们可以通过 https://github.com/codespaces/new 指定海外节点进行 GitHub Codespaces 创建即刻.
推荐阅读
-
什么是 php 开发环境
-
最简单易懂的 C 语言开发环境构建教程,分分钟教你如何在 Windows 中运行第一个 Hello World 程序!
-
如何在 Windows 上使用 WSL 和 VSCode 快速创建 C 语言开发环境
-
最新、最详细的 Python 开发环境构建与 PyCharm 安装配置教程【图+文】【简单易懂】。
-
飞思卡尔 MQX 环境中 Modbus 通信的软件开发
-
飞思卡尔 16 位微控制器(II)--CodeWarrior 开发环境设置和新项目、调试项目
-
S32K]S32K144 入门指南 (1) 从头开始设置开发环境 - 1.起源
-
恩智浦飞思卡尔开发环境设置
-
图形堆栈摘要 (IV) 设置 Mesa 开发环境
-
为什么我花了 1 万多美元购买 MacBook Pro,重点推荐我用于开发写作的工具 - 2. Unix 环境本身。