Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

@Frost208

This comment has been minimized.

Frost208 commented Sep 15, 2018

why this two lines?
passwd
sudo raspi-config

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