"does `apt install curl` exist and is it executable?"

when i run the following:
const response = await axios.post(
${FLY_API_HOSTNAME}/v1/apps/${FLY_APP_NAME}/machines,
{
config: {
init: {
exec: [“apt install curl”]
},
image: “registry-1.docker.io/library/ubuntu:latest”,
auto_destroy: true,
restart: {
policy: “always”
},
guest: {
cpu_kind: “shared”,
cpus: 1,
memory_mb: 256
}
}
}

i get:
ERROR Error: failed to spawn command: apt install curl: No such file or directory (os error 2)
does apt install curl exist and is it executable?

i get that with other commands too…

Due to the semantics of using exec to run stuff, you have to pass it a list of strings not containing spaces as arguments.

exec: ["apt", "install", "curl"] should do the trick.

  • Daniel
1 Like

thanks, sorry for dumb question

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.