Skip to content

Commit b34a68b

Browse files
author
Max Dymond
authored
Merge pull request #439 from Metaswitch/md/flokiworkingdir
Add `FLOKI_WORKING_DIR` environment variable
2 parents 3a6b83c + 301fba0 commit b34a68b

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Status: Available for use
1414
### Breaking Changes
1515

1616
### Added
17+
- Add `FLOKI_WORKING_DIR` environment variable that is accessible inside the
18+
container. Can be used when `mount:` has been specified in `floki.yaml`.
1719

1820
### Fixed
1921

docs/content/intro/feature-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ These can be used to configure users in the container dynamically. This can be a
181181

182182
The host path to the mounted directory is forwarded into the `floki` container as an environment variable, `FLOKI_HOST_MOUNTDIR`.
183183

184-
You can set where this directory is mounted in the container using the `mount` key in `floki.yaml`.
184+
You can set where this directory is mounted in the container using the `mount` key in `floki.yaml`. The mount location is exposed in the `floki` container as an environment variable, `FLOKI_WORKING_DIR`.
185185

186186
## SSH agent
187187

src/interpret.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub(crate) fn run_floki_container(
2323
cmd = cmd.add_environment("FLOKI_HOST_MOUNTDIR", &spec.paths.root);
2424
cmd = cmd.add_environment("FLOKI_HOST_UID", spec.user.uid.to_string());
2525
cmd = cmd.add_environment("FLOKI_HOST_GID", spec.user.gid.to_string());
26+
cmd = cmd.add_environment("FLOKI_WORKING_DIR", &spec.paths.internal_working_directory);
2627
cmd = cmd.set_working_directory(&spec.paths.internal_working_directory);
2728

2829
if spec.user.forward {

0 commit comments

Comments
 (0)