Skip to content
共绩算力文档中心

服务部署中如何使用基础镜像/通过基础镜像保存的镜像

1.当我们 使用基础镜像/通过基础镜像 选择 部署服务

Section titled “1.当我们 使用基础镜像/通过基础镜像 选择 部署服务 时”

2.先进行关机并保存镜像,设置好镜像标签,方便一会选择

Section titled “2.先进行关机并保存镜像,设置好镜像标签,方便一会选择”

当选择的 使用基础镜像/通过基础镜像保存 时需要配置我们预制的运行命令和运行参数才能正常启动:

运行命令:

Terminal window
/bin/bash

运行参数:

Terminal window
-c
Terminal window
/init/init.sh
cat > /etc/supervisord.conf << 'EOF'
[supervisord]
nodaemon=true
[program:sshd]
command=/usr/sbin/sshd -D
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stderr_logfile=/dev/stderr
[program:code-server]
command=/usr/bin/code-server --bind-addr 0.0.0.0:62661
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stderr_logfile=/dev/stderr
[program:jupyterlab]
command=/opt/miniconda3/bin/jupyter-lab --ip=0.0.0.0 --port=8888 --allow-root --no-browser
directory=/root
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stderr_logfile=/dev/stderr
environment=HOME="/root",PATH="/opt/miniconda3/bin:%(ENV_PATH)s"
EOF
exec supervisord -c /etc/supervisord.conf

确认部署镜像配置信息后点击确认部署后,系统将创建弹性部署服务,预计需要 2-5 分钟启动时间。