Setup Docker On Raspbian

how to setup & configure docker on raspbian

January 28, 2017 - 2 minute read -
Raspberry Docker

Originally, we need to install and configure lots of things on a host, no matter it is a traditional host or a VM, when we want to deploy the software or release a service. It is possible and not bad to do that only when we manage less than 5 hosts.

Personally, I hate and refuse to do that manually even when I play with the Raspberry Pi. Ex, here is the Ansible Playbook that I built to configure the Raspberry Pi in order to deploy Pi-Dashboard used to monitor the service running on Raspberry Pi.

DRY automate the things and save your life!

And now, the container is much more popular, it makes the software development, deployment more agile and standardized. You may know Docker – Docker is the world’s leading software containerization platform, and it is committed to build, ship and run software anywhere. More about Docker, please read here What is Docker. what-is-docker


So how to setup and configure Docker on Raspberry?

  • Install OS

  • Update System

    sudo apt-get update
    sudo apt-get dist-upgrade
    sudo reboot
    
  • Install Docker

    • Due to the OS Raspbian is not in the Docker supported list, but there is a script that we can use:
    curl -sSL https://get.docker.com | sh
    

    docker-on-raspbian

  • Verification

    sudo docker version
    ps aux | grep docker
    

    docker-info


Play With Docker

Raspberry is based on ARMv7 architecture, and normal docker images are built with amd64. Please pull and run with the proper ARMv7 images here: ARMv7 Images.

  • Check your system information

uname -a

# mine is here:
# pi@raspberrypi:~ $ uname -a
# Linux raspberrypi 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux
  • Hello World

sudo docker run armhf/hello-world

hello-world-by-docker


支付宝 微信
Share this by: