Code Monkey home page Code Monkey logo

docker-arm's Introduction

Docker on ARM

After a lot of hard work it became official and Docker came to the Raspberry Pi.

In this repository you will find:

  • a curated list of links for getting started with Docker on Pi
  • tutorials around Swarm and Swarm Mode
  • ARM specific images to get you up and running in no time.

If you've not read the Raspberry Pi blog post then you can see it here:

Getting up close and personal with Docker Swarm Mode

Feedback & questions

I'm a Docker Captain so I'd love to hear from you with your questions, comments and suggestions on Twitter @alexellisuk or through the blog comments sections.

License & contributions

This content is licensed under GPLv3. Contributions to keep Dockerfiles up to date and relevant are welcome - also happy to extend the coverage and take updates to the guides. Please just raise an issue before the PR for discussion.

Lead articles

Since I started this repository the installation of Docker and its native clustering modes has changed. This section gives you a summary of tutorials for each part.

Getting started with Docker on the Pi

If you want to see what Docker can do on the Pi, or just want to learn about it then head over to this guide:

New Swarm Mode

Docker Swarm, originally 5 nodes, now 7

Check out my video where I set up a swarm with 7 different Raspbery Pi 2s and demo the Swarm Visualizer project.

For an overview of Swarm Mode:

Mano Marks put together a ReactJS Swarm Visualizer tool. It was originally demoed at Dockercon over three huge screens. He's accepting contributions so this is a great chance to pitch in.

OTG networking for Raspberry Pi

Set up Swarm Mode with OTG networking, look ma, no ethernet!

Physical Hardware and GPIO

One of the most exciting ways Docker and the Raspberry Pi work together is through GPIO. You can access hardware such as the products by Pimoroni through containers and build/ship/run/deploy your apps.

For a prime example see my Dockercon 2016 Demo of a set of IoT sensors:

Classic Docker Swarm

Up until Dockercon 2016 the Docker-way to create a swarm was through a special Docker image called swarm. This repository was commissioned to support a tutorial published in Issue 163 of Linux User and Developer Magazine. If you didn't get a copy of the magazine, you can pick up a digital edition or follow a simplified online guide.

Published print article

This article was retweeted by @Docker on Mar 31 2016, so head over to the blog and have a read.

Follow this quick-start guide to get Docker and/or Swarm up and running on your PI Zeros right away.

ARM specific images

If you want to try Docker or Docker Swarm on ARM or are already using it, then you will find these resources useful:

  • /images

No official Docker images work on the ARM architecture because they contain binaries built for x64 (regular PCs). I've curated separate images for PI 2/3 and PI Zero. You can read more about this in the Getting Started Tutorial

  • Nginx
  • Go 1.5
  • Go 1.6
  • Consul
  • Redis
  • Node.js 4.x
  • Several examples of GPIO
  • Build Docker itself

Contributions are welcome, please open an issue with your suggestion and once confirmed I'll be happy to merge the changes. You can also find a number of additional images maintained by the Hypriot team.

Looking for the old README for this repo?

Head over to README_CLASSIC.md

Copyright Alex Ellis 2016

docker-arm's People

Contributors

actuino avatar alexellis avatar bogdal avatar fredmon3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-arm's Issues

How can I help test Docker for RPi?

The last official Docker binaries for Raspberry Pi (Raspbian) were released in May at version 17.05. 17.05 is fully working including Docker Swarm and is available via curl -sSL get.docker.com | sh.

Support was going to be dropped for Raspbian (and ARMv6) from 17.05 onwards, but fortunately the decision was re-considered.

We need to test Docker 17.07 RC on Raspbian Jessie and Stretch on the ARMv6 (Pi Zero/B/B+) and ARMv7 (RPi 2/3) platforms. Unfortunately this may mean building from source which can take some time and can be tricky on a small device.

Please setup an environment with instructions in #16

Then pick one or all of the following issues:

RPi Zero access RPi 3 L2 Network with OTG

Is it possible to make the RPi Zeros access the RPi 3 network an get an IP address on that network. Assuming all my RPi Zeros are using the OTG network and connected to RPi 3 via USB.

I think I can use something link bridge but didn't tested it yet.

I just mounter my first setup (1 RPi 3 + 4 RPi Zero ), but I'm planning to make other similar setups.

If the RPi Zero is only acessible inside the RPi 3 network, it woldn't be possible to manage all theses RPi Zero workers in a swarm composed of two or more of these kits.

Did you get the point ?

I'll do some tests soon, when I get the module for ethernet and serial to work simultaneously so I can still access the RPi Zeros even if I lose network access. ;)

Swarm is Broken on Docker CE after 17.05 - no services are scheduled.

Issue:

Docker Swarm is broken in Docker CE 17.07

You cannot schedule ARM containers.

Work needed:

We need to rebuild Docker with the follow PR added to see if it resolves the issue.

moby/moby#34021

  • Git clone moby
  • Checkout Moby with the correct 17.07 tag and then run make in the moby directory.
  • You might want to add a swap file for building too

Update: We've tested the issue on ARMv7 but have to repeat for ARMv6 on a Pi Zero. Bootstrap here - #19

Guide: ARMv6 (RPi Zero) bootstrap Jessie or Stretch

To install Docker on ARMv6/PiZero you must follow the tune-up guide #16. Add 1-2GB of swap memory.

Option A: Jessie
Flash Jessie Lite then run:

$ curl -sSL get.docker.com | sh

Option B: Stretch
If you're on stretch then things are more complicated.

Try editing this file and inserting "jessie" instead: /etc/apt/sources.list.d/docker.list

Now you can clone docker/docker and start testing one of the issues listed in this repo under the label: community-supports-docker.

Check your Docker version:

pi@stretch-zero-1:~ $ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@stretch-zero-1:~ $ sudo docker version
Client:
 Version:      17.05.0-ce
 API version:  1.29u
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:30:54 2017
 OS/Arch:      linux/arm

Server:
 Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:30:54 2017
 OS/Arch:      linux/arm
 Experimental: false
pi@stretch-zero-1:~ $ uname -a
Linux stretch-zero-1 4.9.41+ #1023 Tue Aug 8 15:47:12 BST 2017 armv6l GNU/Linux
pi@stretch-zero-1:~ $ 

Before building you will need to apply this patch to the Dockerfile.armhf file:

diff --git a/Dockerfile.armhf b/Dockerfile.armhf
index 6103c5a3a..4a64ca10c 100644
--- a/Dockerfile.armhf
+++ b/Dockerfile.armhf
@@ -15,7 +15,8 @@
 # the case. Therefore, you don't have to disable it anymore.
 #

-FROM armhf/debian:jessie
+#FROM armhf/debian:jessie
+FROM resin/rpi-raspbian:jessie

 # allow replacing httpredir or deb mirror
 ARG APT_MIRROR=deb.debian.org
@@ -78,7 +79,7 @@ ENV GOPATH /go

 # We're building for armhf, which is ARMv7, so let's be explicit about that
 ENV GOARCH arm
-ENV GOARM 7
+ENV GOARM 6

 # Dependency for golint
 ENV GO_TOOLS_COMMIT 823804e1ae08dbb14eb807afc7db9993bc9e3cc3

Deep test of Docker CE 17.07 Swarm on Raspberry Pi

We need to run these tests with the following configuration:

Docker CE 17.07 on Raspbian Jessie

You can get it here - https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2017-07-05/

Docker CE 17.07 on Stretch

You can get it here - https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2017-08-17/

https://github.com/alexellis/swarmmode-tests/tree/master/arm

Swarm quick check list:

https://gist.github.com/alexellis/8e15f2ea1af7281268ec7274686985ba

Tune-up/checking for building Docker

  • Add gpu_mem=16 to /boot/config.txt

  • Create swap - increasing "RAM" by 1GB

$ sudo fallocate -l 1g /swap && \
  sudo mkswap /swap && \
  sudo chmod 0600 /swap

Run this command on each boot, or add to /etc/fstab

$ sudo swapon /swap

Install screen or tmux:

$ sudo apt update && sudo apt install -qy tmux
  • Edit your hostname via raspi-config

  • Run the kernel check:

$ sudo modprobe configs && \
    gunzip -c /proc/config.gz > ~/kernel.config && \
   curl -sSL https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh | bash
  • Optional: upgrade kernel via rpi-update

rpi-update is a package available via apt:

sudo apt update && sudo apt install -qy rpi-update
sudo rpi-update

Pi Zero

๐Ÿ’ฏ

Is that possible to have a single page instruction as on how to do everything on a Zero?

using node source for node dockerfile

fyi nodsource now supports arm so this works very nicely now as opposed to getting the tarball.
This might be perferable. Nodesource is well established so it's a "safe" alternative to grabbing the tarball directly and will look for arm 6,7,8 and load appropriately.

curl -sL https://deb.nodesource.com/setup_7.x | bash -
apt-get install -y nodejs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.