Can't run any program in my environment: `homedir(): no such file or directory`

I’m running Julia in a very minimal Linux container environment with a largely read-only filesystem. The system is based on Arch Linux, and Julia was just installed from Arch’s repositories (pacman -Syu julia, version 1.7.1). Whenever I try to run Julia on anything, even an empty program file, I get the following error message:

fatal: error thrown and no exception handler available.
InitError(mod=:Base, error=Base.IOError(msg="homedir(): no such file or directory (ENOENT)", code=-2))
unknown function (ip: 0x7fc5929406ac)
unknown function (ip: 0x7fc59293f0ad)
unknown function (ip: 0x7fc592a4fab4)
unknown function (ip: 0x7fc592b41291)
unknown function (ip: 0x7fc592b413c8)
unknown function (ip: 0x7fc5a9b3be66)
unknown function (ip: 0x7fc5a9b22de5)
julia_init at /usr/bin/../lib/julia/libjulia-internal.so.1 (unknown line)
jl_repl_entrypoint at /usr/bin/../lib/julia/libjulia-internal.so.1 (unknown line)
main at julia (unknown line)
__libc_start_main at /usr/bin/../lib/libc.so.6 (unknown line)
_start at julia (unknown line)

I think this must be to do with the strange environment I’m running Julia in, but I can’t decipher the error message to work out what I’ve done wrong. Can anyone suggest what this might mean, so I can try to work around the limitations?

Figured it out: I need to set the HOME environment variable to the path of a directory which exists.