Commit 8cb1ef4
Add Dockerfile and devcontainer.json (#174)
This allows both interactive use in IDEs/editors with dev container support as well as building inside the dev container from the command line.
The changes are based on https://github.com/kon-foo/InfiniSim/tree/docker-builder-image.
The original PR was extended with the following features:
- ccache and ninja are installed for optional faster builds. Using ninja instead of make speeds up the build from ~ 28 s to 17 s on my machine with 16 threads.
- git and sudo are added for interactive use of the devcontainer
- Store bash history in volume to preserve it across rebuilds
- The non-root user infinitime with sudo password "it" was added and is used to avoid producing build artifacts owned by root
- Split args into CMake generation time and CMake build time args
- Allow passing the build directory in docker run
- Change the container user to ubuntu:ubuntu since that one already exists anyway. There were also permission issues stemming from not using ubuntu since the external user would likely have UID 1000 (at least on single user systems). That would lead to external files mapped into the container being owned by ubuntu, not infinitime, which has UID 1001
- Split installation into three sections to increase layer granularity for caching
- Remove node install script after usage to reduce container size
- Add gdb to allow debugging inside of the dev container
- Set name of dev container bash history volume to infinisim-bashhistory
Add a workaround for error "Status 500: unable to find user ubuntu: no matching entries in passwd file" when build dev container in CLion
Clion tries to read the local /etc/password when building to change the UID of ther user in the container to the one from outside. If your /etc/passwd does not have this entry, it will fail to build.
Comment this in if you do want to use the dev container CLion (at least CLion 2024.3.4, Build #JBC-243.25659.42. It is reported to Jetbrains).
Co-authored-by: kon-foo <25391223+kon-foo@users.noreply.github.com>
Co-authored-by: NeroBurner <pyro4hell@gmail.com>1 parent 914dc95 commit 8cb1ef4
3 files changed
+127
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
113 | 139 | | |
114 | 140 | | |
115 | 141 | | |
| |||
0 commit comments