Giter Club home page Giter Club logo

code-server's Introduction

Code-Server

自用的 Code Server 镜像,每日构建


使用

Docker 镜像启动参数以 coder/code-server 为准。

启动脚本示例(特别注意替换密码 YOUR_PASSWORD_HERE,如果不需要请删除对应环境参数)

DATA_DIR="$HOME"
# DATA_DIR="/mnt/data"
mkdir -p $DATA_DIR/workspace
mkdir -p $DATA_DIR/docker/vscode/.config
chmod 777 -R $DATA_DIR/docker/vscode
chmod 777 -R $DATA_DIR/workspace

docker run -d \
 --restart always \
 --name vscode \
 --privileged \
 -v $DATA_DIR/workspace:/root/workspace:rw \
 -v $DATA_DIR/docker/vscode:/root/.config:rw \
 -v $HOME/.ssh:/root/.ssh \
 -v $HOME/.gitdir:/root/.gitdir \
 -e PASSWORD=YOUR_PASSWORD_HERE \
 -e TZ=Asia/Shanghai \
 -e PUID=$(id -u ${USER}) \
 -e PGID=$(id -g ${USER}) \
 luoweihua7/code-server:latest \
 /root/workspace \
 --bind-addr 0.0.0.0:8080

部分本地参数说明

仓库代码: /data/workspace
配置映射:/data/docker/vscode
SSH密钥:$HOME/.ssh
GIT配置:$HOME/.gitdir

GIT公共配置放置在镜像的 /root/.gitconfig 文件中,使用的文件为 .gitconfig

使用 includeIf 引用 /root/.gitdir/github.gitconfig 以解决每次更新镜像后都需要重复配置 name/email 的问题


手动构建

默认构建,使用LTS的Node版本,线上最新的pnpm包及其他依赖

docker build -t luoweihua7/code-server:latest .

也可以指定默认的Node版本(需指定数字版本)

NODE_VER=20
docker build --progress=plain -t luoweihua7/code-server:node-v${NODE_VER} -f Dockerfile.node --build-arg NODE_VER=${NODE_VER} .

code-server's People

Contributors

luoweihua7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.