Skip to content

Commit

Permalink
feat: add /tmp
Browse files Browse the repository at this point in the history
Examples of programs that fail when /tmp doesn't exist:
- terraform
- anything using mktemp and similar helpers
  • Loading branch information
jpetazzo authored and tazjin committed Dec 24, 2021
1 parent 3f055f0 commit 5bc3234
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions prepare-image/prepare-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,16 @@ let
name = "bulk-layers";
paths = allContents.contents;

# Ensure that there is always a /usr/bin/env for shell scripts
# that require it.
# Provide a few essentials that many programs expect:
# - a /tmp directory,
# - a /usr/bin/env for shell scripts that require it.
#
# Note that images which do not actually contain `coreutils` will
# still have this symlink, but it will be dangling.
# Note that in images that do not actually contain `coreutils`,
# /usr/bin/env will be a dangling symlink.
#
# TODO(tazjin): Don't link this if coreutils is not included.
# TODO(tazjin): Don't link /usr/bin/env if coreutils is not included.
postBuild = ''
mkdir -p $out/tmp
mkdir -p $out/usr/bin
ln -s ${coreutils}/bin/env $out/usr/bin/env
'';
Expand Down

0 comments on commit 5bc3234

Please sign in to comment.