docker安装code-server
原创小于 1 分钟
docker安装code-server
参考资料
https://github.com/coder/code-server
docker镜像参考资料https://hub.docker.com/r/linuxserver/code-server
自定义Dockfile
FROM linuxserver/code-server:amd64-4.95.3
LABEL maintainer="[email protected]"
WORKDIR /config
ENV TZ=Asia/Shanghai PUID=0 PGID=0
ENV DEFAULT_WORKSPACE=/projects
# install miniconda
RUN curl -L https://mirrors.sustech.edu.cn/anaconda/miniconda/Miniconda3-py310_24.9.2-0-Linux-x86_64.sh -o Miniconda3.sh
RUN bash Miniconda3.sh -b && rm Miniconda3.sh && echo 'export PATH="/config/miniconda3/bin:$PATH"' >> /etc/profile
打包脚本
docker build -t code-server:v1 .
部署
docker run -d --name=code-server -e PASSWORD=password -p 8443:8443 code-server:v1
docker compose 部署
version: '3'
services:
server:
image: code-server:v1
environment:
- PASSWORD=password
restart: always
volumes:
- /config:/config
- /projects:/projects
ports:
- "8443:8443"