在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
拉取镜像# docker pull codercom/code-server # docker images REPOSITORY TAG IMAGE ID CREATED SIZE codercom/code-server latest f3ac734fcec8 12 days ago 802MB 创建挂载目录# CODE=/home/docker/code # mkdir $CODE && cd $CODE 配置文件方法1:从容器中导出 启动一个容器: # docker run -d -u root -p 8088:8080 --name code-server -v $CODE:/home/code codercom/code-server # docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 97707c93cb41 codercom/code-server "/usr/bin/entrypoint…" 3 hours ago Up 3 hours 0.0.0.0:8088->8080/tcp, :::8088->8080/tcp code-server 拉出配置文件: # docker cp code-server:/root/.config/code-server/config.yaml $CODE/ # cat $CODE/config.yaml bind-addr: 127.0.0.1:8080 auth: password password: 59bd4df2841fbc77d67f674f cert: false 改个密码:123456 方法2:直接新建配置文件[ # vim $CODE/config.yaml bind-addr: 127.0.0.1:8080 auth: password password: 123456 cert: false 启动服务# docker stop code-server && docker rm code-server # docker run -d -u root \ -p 8088:8080 \ --name code-server \ -v $CODE/config.yaml:/root/.config/code-server/config.yaml \ -v $CODE:/home/code \ codercom/code-server 访问例如 到此这篇关于docker部署code-server的文章就介绍到这了,更多相关docker部署code-server内容请搜索极客世界以前的文章或继续浏览下面的相关文章希望大家以后多多支持极客世界! |
请发表评论