diff --git a/cli/dstack/_internal/configurators/task.py b/cli/dstack/_internal/configurators/task.py index 9ae03cab4..40a8f1264 100644 --- a/cli/dstack/_internal/configurators/task.py +++ b/cli/dstack/_internal/configurators/task.py @@ -32,9 +32,8 @@ def build_commands(self) -> List[str]: def setup(self) -> List[str]: commands = [] - if self.conf.image: - commands += self.sshd.get_required_commands() - commands += self.sshd.get_setup_commands() + if self.conf.image is None: + commands += self.sshd.get_setup_commands() commands += self.conf.setup return commands