Allow setting of a working directory for the resulting ROCK in rockcraft.yaml
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
**Feature Request**
Lots of software require the user to be in a given directory before the startup command can be called. As of Today, there is no way to set the working directory of a given rock, the default working directory being "/". This forces users to create an entrypoint (or cmd) that `cd's` in a given directory before calling the actual command). It would be great if a `working-directory` field was added to `rockcraft.yaml` that would set the working directory to the provided path.
Here's an example of how the rockcraft.yaml could look:
```yaml
name: magma-orc8r-nms-magmalte
version: "1.6.0"
base: ubuntu:18.04
summary: Magma Orchestrator NMS Magmalte
description: Magma Orcestrator NMS Magmalte
license: Apache-2.0
platforms:
amd64:
cmd: ["/bin/yarn", "run", "start:prod"]
working-directory: "/usr/src/packages/magmalte/"
```
**Expected behaviour**
- The `entrypoint` command is executed from the provided working-directory
- At run time, if you `exec` a command in the container, it is executed from the directory provided in the `rockcraft.yaml` file.
- Ideally: This working directory is available through environment variables inside of parts (ex. `$WORKING_DIRECTORY`).
Evaluation history
No evaluation history available.