2. $Whoami
Sangam Biradar
Github-sangam14
Twitter-BiradarSangam
$curl engineitops.icu
- My Personal Blog Website
- Over 100+ blog post on docker | Golang and kubernetes and
cloud
- Unique 10000+ hits
- Research Papers Presented/Published in the Conference
Proceedings(IEEE)
1.“Build Minimal Docker Container Using Golang’’- presented
and published in the proceedings of the International
Conference ICICCS2018 at Vaigai College Of Engineering,
Madurai 14 June 18
3. Agenda
- Why the IOT Needs Docker?
- How to setup Docker Swarm Cluster on
Raspberry Pi
- Docker Container for Raspberry Pi to Blink
an LED
- Questions?
5. How to setup Docker Swarm
Cluster on Raspberry Pi?
6. Docker Container for
Raspberry Pi to Blink an LED
- Install Docker on Raspberry pi
sudo apt-get update && sudo apt-get upgrade
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker your-username
10. Dockerfile
# Python Base Image from https://hub.docker.com/r/arm32v7/python/
FROM arm32v7/python:2.7.13-jessie
# Copy the Python Script to blink LED
COPY led_blinker.py ./
# Intall the rpi.gpio python module
RUN pip install --no-cache-dir rpi.gpio
# Trigger Python script
CMD ["python", "./led_blinker.py"]
11. docker-build
pi@raspberrypi:~/docker-ledblink $ docker build -t "docker_blinker:v1” .
Sending build context to Docker daemon 3.072kB
Step 1/4 : FROM arm32v7/python:2.7.13-jessie ---> fd232f7d5f5f
Step 2/4 : COPY led_blinker.py ./ ---> Using cache ---> 2c20ac080696
Step 3/4 : RUN pip install --no-cache-dir rpi.gpio ---> Using cache --->
1d7557012625
Step 4/4 : CMD ["python", "./led_blinker.py"] ---> Using cache ---> 856014f90903
Successfully built 856014f90903
Successfully tagged docker_blinker:v1
12. Run Container
pi@raspberrypi:~/docker-ledblink $ docker container run --
device /dev/gpiomem -d docker_blinker:v1
OR
docker container run --privileged -d docker_blinker:v1
Reference :
https://github.com/raspberrypi/linux/pull/1112
14. You should see it
successfully Running
Cheers !
Stop container :-
docker stop $(docker ps -a -q)
https://github.com/collabnix/dockerlabs/blob/master/
beginners/install/raspberrypi3/Docker-
IOT_Using_Arduino_Uno_and_Johnny-Five.md