美文网首页Sail中文文档
Sail中文文档:一个开发环境快速部署工具-14-Sail命令之

Sail中文文档:一个开发环境快速部署工具-14-Sail命令之

作者: 枫山别院 | 来源:发表于2019-08-22 15:50 被阅读0次

    欢迎访问我的博客,同步更新: 枫山别院

    14-Sail命令之run

    Usage: sail run [flags] <repo>
    
    # 运行一个项目容器
    # 如果这个项目还没有创建或者没有运行,那么就会创建这个项目,并且会打开一个新的编辑器。如果这个项目已经启动了,那就不会再启动一个新的容器了,但是这个容器会重新启动并打开一个新的编辑器。
    
    # 如果没有提供模式和主机地址,Sail会通过SSH访问github,要修改的话,有好几种方法:
    
    1. Specify a host. See examples section
    2. Specify a schema and host. See examples section
    3. Edit the config to provide your preferred defaults.
    
    Examples:
        Use default host and schema(模式) (github.com over SSH, editable in config)
        - sail run cdr/code-server
    
        #强制通过ssh访问Github仓库(假设默认使用git用户)
        - sail run ssh://github.com/cdr/sshcode
        - sail run --ssh github.com/cdr/sshcode
    
        # 自定义一个ssh服务地址
        - sail run ssh://colin@git.colin.com/super/secret-repo
        - sail run --ssh colin@git.colin.com/super/secret-repo
    
        # 强制使用HTTPS访问Gitlab仓库
        - sail run https://gitlab.com/inkscape/inkscape
        - sail run --https gitlab.com/inkscape/inkscape
        
    # 注意:
    # 如果是使用ssh://, http://, or https://,你必须声明主机地址
    
    # 这样是错误的:
        - sail run ssh://cdr/code-server
    
    # 您应该添加flags参数来避免使用主机地址.
    # 这是正确的:
        - sail run --ssh cdr/code-server
    
    sail run flags:
        --hat   自定义要使用的hat.
        --http  Clone repo over HTTP (false)
        --https Clone repo over HTTPS (false)
        --image Custom docker image to use.
        --keep  Keep container when it fails to build. (false)
        --no-open   Don't open an editor session (false)
        --rm    Delete existing container (false)
        --ssh   Clone repo over SSH (false)
        --test-cmd  A command to use in-place of starting code-server for testing purposes.
    

    run命令会启动一个容器,并且打开项目的浏览器窗口。

    浏览器

    尽可能的使用Chrome浏览器,因为Sail在Chrome中有个--app模式,这个模式下code-server的使用体验就跟本地的VS Code的差不多。如果没有Chrome的话,Sail就会用系统默认的浏览器打开一个网址。

    相关文章

      网友评论

        本文标题:Sail中文文档:一个开发环境快速部署工具-14-Sail命令之

        本文链接:https://www.haomeiwen.com/subject/tmnnsctx.html