Change Entrypoint Command & Args
To change the start command for your dev container, you can use the following options:
command
to change the entrypointargs
to change the arguments provided to the entrypoint command
devspace.yaml
dev:
backend:
imageSelector: ghcr.io/org/project/image
devImage: ghcr.io/loft-sh/devspace-containers/python:3-alpine
command: ["npm"]
args: ["run", "start"]
The dev container shown in the example above would be started with the command npm run start
.
Automatic Sleep Modification For Terminal
If you enable the terminal
for this dev container, DevSpace will assume that you manually want to start your application using the terminal session and it automatically changes the container entrypoint to sleep
:
devspace.yaml
dev:
backend:
imageSelector: ghcr.io/org/project/image
devImage: ghcr.io/loft-sh/devspace-containers/python:3-alpine
# Terminal is enabled
terminal:
command: ./devspace_start.sh
# The following will automatically be added by DevSpace in-memory:
# command: ["sleep"]
# args: ["1000000000"]
To disable the automatic modifications of the entrypoint for terminal-enabled dev containers, add disableReplace: true
under the terminal
settings.
Config Reference
command
required string[]
Command can be used to override the entrypoint of the container
command
required string[] args
required string[]
Args can be used to override the args of the container
args
required string[]