Containers 2026
Note on Devcontainers
Found this first:
Followed only the install step of these steps . . . this article seems to be talking about some software called "Zephyr" which is unrelated to Zephyr RTOS Project:
(2) https://docs.docker.com/engine/install/ubuntu/s
Mention here of `compose.yml`:
(3) https://embedded-house.ghost.io/zephyr-with-dev-containers/
Goliath company post on devcontainers:
(4) https://blog.golioth.io/build-before-installing-zephyr-dev-environment-using-codespaces/
An example .devcontainer file here but article is Java specific an talks a lot about a Java project.
(5) https://medium.com/versent-tech-blog/introduction-to-dev-containers-4c01cb1752a0
Best article yet, more general but good explanation:
(6) https://containers.dev/guide/dockerfile
A github project with example `devcontainer.json` and `docker-compose.yml`:
ZephyrRTOS-Project docker image repo:
(8) https://github.com/zephyrproject-rtos/docker-image
Post commands support:
First Docker compose based container set up:
Notes about devcontainer start up script elements
To build on localhost using the Docker composed container, a start up script cam be written in the Zephyr or other local copy of a project, to check for and to invoke `devcontainer` with necessary arguments.
Such a script will likely first assure that it is running from the same directory as where the `.devcontainer` folder lives, if it is not already there. The scripts may then:
[ ] check that `devcontainer` is installed by trying to call it (shell built-in `command` may be helpful with this test) [ ] assure that a `docker_cache` directory exists in the project root dir
(create `./docker_cache` if not found)
[ ] check whether the container is running and if not start it (see note 1) [ ] check whether any project specific container config is complete
Notes: (1) The checks for "container running" and "config complete" can be combined into a single function. This reflects the fact that we likely only want to run the container and have our container start helper script report success when the container is fully configured for the given project.
Other functions in the helper script call `devcontainer` with tokens which start with its `exec` option. In a shell script, this `exec` option is usually followed by a double quoted string to express the commands we would issue at a command shell. For example, commands to build the app, to build menuconfig, to execute tests, and related things.
devcontainer exec uses
Stuart Leeks help document on devcontainer exec use:
@devcontainers/cli
Important to stall the following Python scripts mentioned here:
Command is:
$ npm install -g @devcontainers/cli
WorkspaceMount and workspaceFolder options:
Introspective Commands
To format the output of `docker ps -a` which truncates some output by default: