Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Set Up Docker On Raspberry Pi Raspbian Stretch Lite


Headless reinstall and update

Enable SSH on the SD Card

  • create a text file in /boot/ called ssh

Once you can SSH in:

Command line setup

sudo raspi-config
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install tmux
sudo dpkg-reconfigure tzdata
sudo apt-get install git -qy --no-install-recommends

Install the Docker client

curl -sSL | sh
sudo systemctl enable docker
sudo systemctl start docker
sudo usermod -aG docker pi

# didn't need the following line on the RPi3
sudo echo " cgroup_enable=memory cgroup_memory=1" >> /boot/cmdline.txt

sudo reboot

docker run -ti arm32v6/alpine:3.5 /bin/sh
docker run -d -p 80:80 hypriot/rpi-busybox-httpd
docker run -d -p 8000:8000 hypriot/rpi-python
# the following is designed to work with the Blinkt hardware, but I just wanted to document the syntax used.
docker run --name iot --restart=always --privileged -d alexellis2/cheerlights:0.1
docker ps

More Docker info


This comment has been minimized.

Copy link

Frost208 commented Sep 15, 2018

why this two lines?
sudo raspi-config


This comment has been minimized.

Copy link

slimcdk commented Feb 10, 2019


To configure your Raspbian installation.


This comment has been minimized.

Copy link

Smitty357 commented May 16, 2019

docker run -ti arm32v6/alpine:3.5 /bin/sh
This just hangs my terminal. I have to exit it or ctrl+p then ctrl+q to exit but leave running. Suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.