Skip to content

Instantly share code, notes, and snippets.

@pixelistik
Last active August 29, 2015 14:09
Show Gist options
  • Save pixelistik/1aa9c35618974640bb46 to your computer and use it in GitHub Desktop.
Save pixelistik/1aa9c35618974640bb46 to your computer and use it in GitHub Desktop.
Docker on a Raspberry Pi
  • Get a Raspberry
  • Install Archlinux on it, see http://archlinuxarm.org/platforms/armv6/raspberry-pi
  • Get latest package info: pacman -Sy
  • install sudo pacman -S sudo
  • create a user in group wheel useradd -m -G wheel -s /bin/bash pixelistik
  • in /etc/sudoers allow everything to wheel group visudo, uncomment the %wheel line
  • mkdir .ssh
  • chmod 755 .ssh/
  • nano .ssh/authorized_keys and paste public key
  • chmod 644 .ssh/authorized_keys
  • pacman -S docker
  • add user to docker group to get permissions to run docker commands usermod -aG docker pixelistik
  • start docker daemon sysctl start docker (sysctl enable docker probably makes it persistent)
  • get a base image that matches the host docker pull sdhibit/rpi-arch (could probably be any other ARM-based Linux, e.g. Raspbian)
  • write a Dockerfile
  • build the docker image, saving it under a tag docker build -t estimation-poker .
  • run the image, publishing port 5000: docker run -p 5000:5000 estimation-poker
# Base on ARM image
FROM sdhibit/rpi-arch
# Install required packages
RUN pacman -Sy && pacman --noconfirm -S nodejs git
# Get app code
RUN git clone https://github.com/pixelistik/estimation-poker.git
WORKDIR estimation-poker
# Install dependencies
RUN npm install
# Define default command to run
ENTRYPOINT ["node", "server.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment