Skip to content

Instantly share code, notes, and snippets.

@DieterReuter
Last active August 6, 2016 15:38
Show Gist options
  • Save DieterReuter/14271bc70727feed76e96381f188b4f2 to your computer and use it in GitHub Desktop.
Save DieterReuter/14271bc70727feed76e96381f188b4f2 to your computer and use it in GitHub Desktop.
Upgrade HypriotOS 0.8.3 with Docker 1.12.0 and compile Docker 1.12.0 (plus ARM patch)
#!/bin/bash
set -e
set -x
if [ ! -f ~/docker-engine_1.12.0-0~jessie_armhf-armv6.deb ]; then
echo "...ERROR:"
echo " Package ~/docker-engine_1.12.0-0~jessie_armhf-armv6.deb missing"
exit 1
fi
#---update Docker package
# create systemd unit file with overlay2 storage option
sudo mkdir -p /etc/systemd/system
curl -sSL https://raw.githubusercontent.com/docker/docker/master/contrib/init/systemd/docker.service | sudo tee /etc/systemd/system/docker.service >/dev/null
sudo sed -i 's/dockerd/dockerd --storage-driver overlay2/' /etc/systemd/system/docker.service
# update apt infos
sudo apt-get update
# remove old docker-hypriot package
sudo apt-get purge -y docker-hypriot
# install new docker-engine package
sudo dpkg -i docker-engine_1.12.0-0~jessie_armhf-armv6.deb
docker version
docker info
#---compile Docker 1.12.0 on ARM
# set git username and email address
git config --global user.email "[email protected]"
git config --global user.name "Dieter Reuter"
# install development dependencies
sudo apt-get install -y make dphys-swapfile
# clone Docker repo
git clone https://github.com/docker/docker.git
cd docker
git checkout v1.12.0
# cherry pick the PR#25192 (ARM fix)
git fetch origin pull/25192/head:fix-manpages-on-arm
git cherry-pick fix-manpages-on-arm
# compile Docker
echo "...setup complete"
echo "...compile Docker 1.12.0 (incl. PR#25192)"
echo " time make deb"
@DieterReuter
Copy link
Author

DieterReuter commented Aug 5, 2016

Just run the script on a freshly flashed HypriotOS:

  • copy the .deb from Mac to the Pi
scp docker-engine_1.12.0-0~jessie_armhf-armv6.deb [email protected]:
  • detect a real httpredir.debian.org host ip address
curl -v -4 -L http://httpredir.debian.org/debian/dists 2>&1 | grep "\* Connected to "
* Connected to httpredir.debian.org (5.153.231.35) port 80 (#0)
* Connected to ftp.fau.de (131.188.12.211) port 80 (#1)
* Connected to ftp.fau.de (131.188.12.211) port 80 (#1)
  • update /etc/hosts file
export DEBIAN_IP=$(curl -v -4 -L http://httpredir.debian.org/debian/dists 2>&1 | grep "\* Connected to " | tail -1 | cut -d\( -f2 | cut -d\) -f1)
echo "$DEBIAN_IP   httpredir.debian.org" | sudo tee -a /etc/hosts
  • upgrade Docker and clone the Docker repo
time curl -sSL https://gist.github.com/DieterReuter/14271bc70727feed76e96381f188b4f2/raw/0e354a6b72d0ad87aa605b4604f40c4c518481c6/compile-docker-1.12.0-on-arm.sh | bash
  • build Docker
time make deb

---or---

time AUTO_GOPATH=1 DOCKER_BUILD_ARGS="--build-arg APT_MIRROR=131.188.12.211" hack/make.sh build-deb

---or---

time AUTO_GOPATH=1 DOCKER_BUILD_PKGS="raspbian-jessie" hack/make.sh build-deb
time AUTO_GOPATH=1 DOCKER_BUILD_PKGS="debian-jessie" DOCKER_BUILD_ARGS="--build-arg APT_MIRROR=131.188.12.211" hack/make.sh build-deb
time AUTO_GOPATH=1 DOCKER_BUILD_PKGS="ubuntu-trusty" hack/make.sh build-deb

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