gpt4 book ai didi

docker - 部署 jupyterhub 时无法从 config.yaml 运行生命周期命令

转载 作者:行者123 更新时间:2023-12-02 12:04:11 28 4
gpt4 key购买 nike

我想在创建 pod 并开始运行后立即运行命令。我正在部署 jupyterhub但我使用的配置是:

proxy:
secretToken: "yada yada"
singleuser:
image:
# Get the latest image tag at:
# https://hub.docker.com/r/jupyter/datascience-notebook/tags/
# Inspect the Dockerfile at:
# https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook/Dockerfile
name: jupyter/datascience-notebook
# name: ${IMAGE}
tag: 177037d09156
# tag: latest
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]

当 pod 启动并运行时,我看不到文件 /usr/share/message因此,我推断 exec 命令没有运行。

使此命令起作用的正确方法是什么?

最佳答案

的正确键生命周期 节是 生命周期钩子(Hook) .

以下 blob 具有正确的值。

proxy:
secretToken: "yada yada"
singleuser:
image:
# Get the latest image tag at:
# https://hub.docker.com/r/jupyter/datascience-notebook/tags/
# Inspect the Dockerfile at:
# https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook/Dockerfile
name: jupyter/datascience-notebook
# name: ${IMAGE}
tag: 177037d09156
# tag: latest
lifecycleHooks:
postStart:
exec:
command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]

关于docker - 部署 jupyterhub 时无法从 config.yaml 运行生命周期命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56170284/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com