-
Notifications
You must be signed in to change notification settings - Fork 308
Emdocker
Build & test environment on docker. Allows to setup fully working development environment in one command.
Please refer to Docker installation instructions:
- MacOS, Windows and may be Linux: https://docs.docker.com/engine/getstarted/step_one/
- Linux: your distribution manual
- FreeBSD: https://wiki.freebsd.org/Docker
On MacOS/Windows, consider using Docker Toolbox at first.
Docker for Mac (Docker.app) is alternative for Docker Toolbox. Try to use Docker Toolbox at first.
If you end up with Docker for Mac, make sure Docker Toolbox and Docker for Mac are not interfer. The simpliest way is to uninstall Docker Toolbox completely, as described in https://forums.docker.com/t/solved-how-to-cleanly-uninstall-docker-toolbox/13411
After that:
-
Install VirtualBox: https://www.virtualbox.org/wiki/Downloads
-
Launch Docker.app.
-
Unless you already have set up a default Docker machine, run:
docker-machine create --driver virtualbox default
-
Run
docker-machine start default
Complete instructions for Docker for Mac can be found here.
-
Open terminal, change directory to embox project root.
-
On MacOS, make sure that you Docker machine is up and running:
docker-machine ls docker-machine start default
-
Start docker container with
./scripts/docker/docker_start.sh
-
Source bash docker utillities
. ./scripts/docker/docker_rc.sh
This mostly defines dr
(from docker run) alias. Every command prepended with dr
will be executed in container. Now you're ready to test you new shiny environment, like
dr echo I am alive!
-
That's all! Now you can build and test embox in the contaner. Just remember to type
dr
. For example, reassembling main README:dr make confload-x86/qemu dr make dr ./scripts/qemu/auto_qemu -s -S
-
Show active Docker containers:
docker ps
-
Kill and remove your container (will not delete the image):
docker rm -f YOUR_CONTAINER_ID
-
On MacOS, you could stop the Docker machine also:
docker-machine stop default
Few notes on gdb (client). Bare dr gdb
will not work all the time, because this will handle signal wrong way, closing the container wrapper instead of signaling to gdb. Particullary, Ctrl+C
will not interrupt application and invoke gdb REPL.
To fix this, ./scripts/docker/gdbhostwrapper
introduced to passthrough singals to gdb running in container. Just use it as gdb starter script on host computer, from any environment like shell or Eclipse.
Eclipse already have some emdocker support. However, it requires PATH to include embox's scripts/docker
directory. So recommended way to start Eclipse is from embox root directory like
PATH=$PATH:$PWD/scripts/docker/ PATH/TO/eclipse &
Support includes:
-
docker-run
make build target used to build embox (depends ondocker_run.sh
) -
qemu_on_docker
debugging target used to debug embox on qemu, which runs in container. Target havegdbhostwrapper
specified as a debugger, as Eclipse use gdb as debugger backend and sends signals too (refer to gdb section for details)
For simple CLI network access to embox one can type dr bash
and get container's bash session. There embox is accessible as usual (ping 10.0.2.16
, curl 10.0.2.16:80
)
To access embox services from host, you should know host running the container. On linux, this is localhost
. On MacOS/Windows with classic Docker, type docker-machine ip
and get host's ip. Then use this ip address and port (10000 + embox_port) to access the service. For example localhost:10080
on linux will be redirected embox's port 80.
- Embox on QEMU emulator
- ARM
- AARCH64
- x86
- MIPS
- RISC-V
- PowerPC
- DLX (Microblaze)
- SPARC
- Porting to a new architecture
- Audio
- FPGA
- FS
- Graphics
- NET
- USB
- iec61850
- C Plus Plus
- GY 30 I2C light sensor on STM32
- STM32FLASHER
- Emdocker
- Emdocker on MAC
- Xen port workflow
- Troubleshooting
- QEMU with GRUB2 and Syslinux
- LKL subsystem
- Beremiz
- 4diac Forte