Open an interactive container shell for building Nerves packages
This is useful when modifying or debugging the prebuilt contents of
Nerves packages. Builds are run using the container provider found
on your computer or by setting the NERVES_CONTAINER_TOOL environment
variable to docker, podman, or container.
Nerves does not specify how package artifacts get built. Buildroot, for
example, uses make and has commands like make menuconfig and
make savedefconfig. Source changes made in the container are copied
back to the host when the shell exits.
IMPORTANT: You can run mix nerves.artifact.shell in a Nerves project. Just
be aware that you're modifying a dependency and any changes may be under
the deps directory.
Run mix nerves.artifact.ls to see the containers created by the Nerves tooling
and mix nerves.artifact.purge to delete them.
Examples
Building from within a Nerves package:
$ cd nerves_system_rpi0
$ mix nerves.artifact.shell
# In the container now
nerves@6a5c16134cca:/workspace/build$ make
...
# The way to make the final tarball is package-specific, but
# this works for nerves_system_br-based projects.
nerves@6a5c16134cca:/workspace/build$ make system
Building a Nerves-aware dependency:
$ MIX_TARGET=rpi0 mix nerves.artifact.shell nerves_system_rpi0