Commit 22cdd3a
python: ship nsjail so shimmy's --sandbox works
shimmy provides the --sandbox (nsjail) feature and its own runtime image
builds nsjail from source into /usr/sbin/nsjail. This base image copies
only the shimmy binary (`COPY --from=shimmy /shimmy`), not nsjail or its
shared libraries, so any evaluation function that sets SANDBOX_ENABLED=true
has shimmy fail at startup (os.Stat("/usr/sbin/nsjail") -> not found).
Add a nsjail-builder stage that builds nsjail 3.4 from source on the same
python:<ver>-slim-bookworm image used at runtime, so the glibc / libstdc++
/ libprotobuf ABIs match (a binary copied from shimmy's ubuntu:24.04 image
would link against a newer glibc than bookworm provides). Copy the binary
in and install its three runtime libs (libcap2, libnl-route-3-200,
libprotobuf32). A build-time `ldd` check fails the build if a lib is
missing.
nsjail is dormant unless a function opts into --sandbox, so behaviour is
unchanged for every existing image consumer.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RYbUtnGroazAj1fNjXQmV71 parent 338e326 commit 22cdd3a
1 file changed
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
18 | 33 | | |
19 | 34 | | |
20 | 35 | | |
| |||
27 | 42 | | |
28 | 43 | | |
29 | 44 | | |
30 | | - | |
| 45 | + | |
| 46 | + | |
31 | 47 | | |
32 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
33 | 52 | | |
34 | 53 | | |
35 | 54 | | |
36 | 55 | | |
37 | 56 | | |
38 | 57 | | |
39 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
40 | 62 | | |
41 | 63 | | |
42 | 64 | | |
43 | 65 | | |
44 | 66 | | |
45 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
46 | 71 | | |
47 | 72 | | |
48 | 73 | | |
0 commit comments