Abstract
Setting up an embedded tool chain on a local PC or laptop requires very often to spend an enormous amount of time for installation and configuration of the individual software packages. It ends up in a "golden" installation on a single computer that is kept like a treasure. But with each new package installed on this computer, the golden installation is in danger.Docker provides a light weight virtualization engine that runs on Linux, Windows or MacOS.
Docker containers contain virtual guest OSes and can easily be configured, deployed and executed. The article descibes how to create a suitable container for embedded software development and how to use it.
Installing Docker
In the first step, install docker on the local PC. We use the Docker Community Edition (Docker CE). On the docker installationpage click on your OS to get the latest installation instructions.
To run docker on Ubuntu as normal user, do
- add the user to the "docker" group
sudo gpasswd -adocker - log off and log on again
$ docker run hello-world
Create the first Docker Image
Create a working directory and add the file Dockerfile in it.Edit the file Dockerfile and add the following content:
FROM ubuntu MAINTAINER Main Tainer maintainer@example.org RUN apt-get update \ # install packages && apt-get -y install \ # build system related scons mercurial \ # Python packages python python-pip \ # AVR Tools binutils-avr gcc-avr avr-libc \ # Documentation tools doxygen # we skip doxygen-latex here, otherwise the image becomes "huuuuge" RUN useradd -ms /bin/bash uracoli USER uracoli RUN mkdir /home/uracoli/work WORKDIR /home/uracoli/work # command is running at start of the container CMD \ echo == starting uracoli-development environment == \ && /bin/bash
To create the image run the command:
$ docker build -t my-uracoli-env .
The command creates an image named "my-uracoli-env".
It inherits from the latest Ubuntu installation. The "RUN" commands
- install the standard Linux packages required to compile the µracoli project
- create a user uracoli
- create a working directory /home/uracoli/work
The "CMD" statement at the end of the file is executed at every start of the container. It issues a message and starts bash.
First Run of the Container
After successfully creating the container, run the command
docker run -t -i my-uracoli-env
in a terminal
$ docker run -t -i u5idev == starting uracoli-development environment == uracoli@6f065accfc17:~$
On this shell prompt type pwd to see that you are in the directory /home/uracoli/work.
Your first development session might start with the following commands:
uracoli@9311c77b2d54:~/work/uracoli$ hg clone http://hg.savannah.nongnu.org/hgweb/uracoli/ destination directory: uracoli ... uracoli@9311c77b2d54:~/work/uracoli$ cd uracoli uracoli@9311c77b2d54:~/work/uracoli$ scons radiofaro scons: Reading SConscript files ... build 1 of 104 boards ...
Adding some Comfort
After ending (Ctrl-D) and restarting the docker session, you will notice that the docker container is suffered from amnesia. That means, after the next restart the directory /home/uracoli/work is empty. Also editing source code with terminal tools like "nano" or "vi" might not fit your regular development habits. To circumvent this, we simply map a local directory from the host computer into the docker container. So you can edit the files from the host machine with your favourite IDE or source-code editor. Mapping a local directory to docker is done by passing the -v option to the run command.docker run -v /home/axel/Work/uracoli-aw:/home/uracoli/work -it my-uracoli-env
Now you can edit the files on the host compile and compile it in the docker container.
Mapping Serial Devices into Docker
On Ubuntu it is possible to map serial devices into the docker container with the following command:$ docker run --device=/dev/ttyUSB0 -v .... -it my-uracoli-env
System Clean Up
While experimenting with docker, a lot of logfiles from different sessions and temporary images may waste a enormous amount of disk space. To get rid of this left overs, you can use the follwing commands on Linux/Ubuntu to clean the system$ docker rm $(docker ps -aq) $ docker rmi $(docker images -f "dangling=true" -q)
Hi your blog is very really impressive and informative i learnt alot from your article.it is useful for all who wants to know about
AntwortenLöschenembedded software development services
Nice Blog...
AntwortenLöschenThanks for Sharing...
AVR Training, Embedded Systems Training, Embedded Systems Training Institute in Noida
Thank you.Well it was nice post and very helpful information on Azure Online Training
AntwortenLöschenNice blog Content.It is very informative and helpful. Please share more content. Thanks.
AntwortenLöschenMicrocontroller Training in Delhi
An interesting and interesting article. Thanks for sharing
AntwortenLöschenlều xông hơi mini
mua lều xông hơi ở đâu
lều xông hơi gia đình
bán lều xông hơi
xông hơi hồng ngoại
ok
AntwortenLöschencửa lưới chống muỗi
cửa lưới chống muỗi Hà Nội
kayseriescortu.com - alacam.org - xescortun.com
AntwortenLöschenafyon masöz
AntwortenLöschenburdur masöz
bilecik masöz
amasya masöz
yalova masöz
konak masöz
karabük masöz
kırşehir masöz
kütahya masöz
perde modelleri
AntwortenLöschensms onay
mobil ödeme bozdurma
nftnasilalinir
Ankara Evden Eve Nakliyat
trafik sigortası
Dedektor
Site kurma
ASK KİTAPLARİ
smm panel
AntwortenLöschensmm panel
isilanlariblog.com
instagram takipçi satın al
hirdavatciburada.com
https://www.beyazesyateknikservisi.com.tr/
Servis
tiktok jeton hilesi
cPanel License is a popular web hosting control panel that simplifies the process of website and server management.
AntwortenLöschen