Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mkol5222
Forked from davidbradway/setup.md
Created July 12, 2018 07:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkol5222/6c153ca804146604fde66e57dcec2975 to your computer and use it in GitHub Desktop.
Save mkol5222/6c153ca804146604fde66e57dcec2975 to your computer and use it in GitHub Desktop.
Set Up Docker On Raspberry Pi Raspbian Stretch Lite

Setup

Headless reinstall and update https://raspberrypi.stackexchange.com/a/57023

Enable SSH on the SD Card

  • create a text file in /boot/ called ssh

Once you can SSH in:

https://gist.github.com/davidbradway/ecde825a6981d8a7f99d6c7691139f9b

Command line setup

passwd
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
ifconfig

Install the Docker client

curl -sSL https://get.docker.com | 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
# https://stackoverflow.com/questions/47520693/raspbian-docker-error-response-from-daemon-cgroups-memory-cgroup-not-supporte

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment