Skip to content

Commit

Permalink
Merge pull request #106 from DieterReuter/update-docker-ce-18.09.7
Browse files Browse the repository at this point in the history
Update Docker 18.09.7 (built for Debian Stretch ARM64)
  • Loading branch information
DieterReuter authored Jul 14, 2019
2 parents 1d8d14f + 1d798ac commit 909cc5a
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 50 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ ENV FETCH_MISSING_ARTIFACTS=true \
KERNEL_ARTIFACT=4.19.58-hypriotos-v8.tar.gz \
BOOTLOADER_ARTIFACT=rpi-bootloader.tar.gz \
RAW_IMAGE_ARTIFACT=rpi-raw.img.zip \
DOCKER_ENGINE_VERSION="18.04.0~ce~3" \
DOCKER_ENGINE_VERSION="5:18.09.7~3-0~debian-stretch" \
CONTAINERD_IO_VERSION="1.2.6-3" \
DOCKER_COMPOSE_VERSION="1.24.1" \
DOCKER_MACHINE_VERSION="0.16.1" \
KERNEL_VERSION="4.19.58" \
Expand Down
90 changes: 48 additions & 42 deletions builder/chroot-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,39 @@ mkdir -p /var/lib/cloud/seed/nocloud-net
ln -s /boot/user-data /var/lib/cloud/seed/nocloud-net/user-data
ln -s /boot/meta-data /var/lib/cloud/seed/nocloud-net/meta-data

# enable Docker Engine experimental features
mkdir -p /etc/docker/
echo '{
"experimental": true
}
' > /etc/docker/daemon.json

# set up Docker APT repository and install official Docker CE packages
# see: https://docs.docker.com/install/linux/docker-ce/debian/
#
# Install packages to allow apt to use a repository over HTTPS:
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common
# Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
# Verify fingerprint of Docker’s official GPG key:
apt-key fingerprint 0EBFCD88
# Set up set the stable Docker repository:
add-apt-repository \
"deb [arch=arm64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
# Install Docker CE
apt-get update
apt-get install -y \
docker-ce="${DOCKER_ENGINE_VERSION}" \
docker-ce-cli="${DOCKER_ENGINE_VERSION}" \
containerd.io="${CONTAINERD_IO_VERSION}"

# install Docker Machine directly from GitHub releases
curl -sSL "https://github.com/docker/machine/releases/download/v${DOCKER_MACHINE_VERSION}/docker-machine-Linux-aarch64" \
> /usr/local/bin/docker-machine
Expand All @@ -223,48 +256,21 @@ chmod +x /usr/local/bin/docker-machine
# install bash completion for Docker Machine
curl -sSL "https://raw.githubusercontent.com/docker/machine/v${DOCKER_MACHINE_VERSION}/contrib/completion/bash/docker-machine.bash" -o /etc/bash_completion.d/docker-machine

# install Docker Compose via pip
apt-get install -y \
build-essential libffi-dev libssl-dev python python-dev
curl -sSL https://bootstrap.pypa.io/get-pip.py | python
pip install docker-compose=="${DOCKER_COMPOSE_VERSION}"
apt-get purge -y \
build-essential libffi-dev libssl-dev python-dev
apt-get autoremove -y --purge
apt-get autoclean
apt-get clean

# install bash completion for Docker Compose
curl -sSL "https://raw.githubusercontent.com/docker/compose/${DOCKER_COMPOSE_VERSION}/contrib/completion/bash/docker-compose" -o /etc/bash_completion.d/docker-compose

# # set up Docker APT repository and install docker-engine package
# #TODO: pin package version to ${DOCKER_ENGINE_VERSION}
# curl -sSL https://get.docker.com | /bin/sh

# enable Docker Engine experimental features
mkdir -p /etc/docker/
echo '{
"experimental": true
}
' > /etc/docker/daemon.json

#TODO:+++ change to Debian Stretch official repo, as soon as it's available
# install Docker CE directly from Docker APT Repo but built for Debian Stretch ARM64
DOCKER_DEB="docker-ce_${DOCKER_ENGINE_VERSION}-0~debian_arm64.deb"
curl -sSL "https://download.docker.com/linux/debian/dists/stretch/pool/edge/arm64/$DOCKER_DEB" \
> "/$DOCKER_DEB"
if [ -f "/$DOCKER_DEB" ]; then
# install some runtime requirements for Docker CE
apt-get install -y libapparmor1 libltdl7 libseccomp2

# install Docker CE
dpkg -i "/$DOCKER_DEB" || /bin/true
rm -f "/$DOCKER_DEB"

# fix missing apt-get install dependencies
apt-get -f install -y
fi
#TODO:---
#---DISABLE DOCKER COMPOSE---
# # install Docker Compose via pip
# apt-get install -y \
# build-essential libffi-dev libssl-dev python python-dev
# curl -sSL https://bootstrap.pypa.io/get-pip.py | python
# pip install docker-compose=="${DOCKER_COMPOSE_VERSION}"
# apt-get purge -y \
# build-essential libffi-dev libssl-dev python-dev
# apt-get autoremove -y --purge
# apt-get autoclean
# apt-get clean
#
# # install bash completion for Docker Compose
# curl -sSL "https://raw.githubusercontent.com/docker/compose/${DOCKER_COMPOSE_VERSION}/contrib/completion/bash/docker-compose" -o /etc/bash_completion.d/docker-compose
#---DISABLE DOCKER COMPOSE---

echo "Installing rpi-serial-console script"
wget -q https://raw.githubusercontent.com/lurch/rpi-serial-console/master/rpi-serial-console -O usr/local/bin/rpi-serial-console
Expand Down
37 changes: 31 additions & 6 deletions builder/test-integration/spec/hypriotos-image/docker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,21 @@

describe command('dpkg -l docker-ce') do
its(:stdout) { should match /ii docker-ce/ }
its(:stdout) { should match /18.04.0~ce~3-0~debian/ }
its(:stdout) { should match /5:18.09.7~3-0~debian/ }
its(:stdout) { should match /arm64/ }
its(:exit_status) { should eq 0 }
end

describe command('dpkg -l docker-ce-cli') do
its(:stdout) { should match /ii docker-ce-cli/ }
its(:stdout) { should match /5:18.09.7~3-0~debian/ }
its(:stdout) { should match /arm64/ }
its(:exit_status) { should eq 0 }
end

describe command('dpkg -l containerd.io') do
its(:stdout) { should match /ii containerd.io/ }
its(:stdout) { should match /1.2.6-3/ }
its(:stdout) { should match /arm64/ }
its(:exit_status) { should eq 0 }
end
Expand All @@ -17,25 +31,36 @@
it { should be_owned_by 'root' }
end

describe file('/usr/bin/docker-containerd') do
describe file('/usr/bin/docker-init') do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by 'root' }
end

describe file('/usr/bin/docker-containerd-ctr') do
describe file('/usr/bin/docker-proxy') do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by 'root' }
end

describe file('/usr/bin/dockerd') do
it { should be_file }
it { should be_owned_by 'root' }
end

describe file('/usr/bin/dockerd-ce') do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by 'root' }
end

describe file('/usr/bin/docker-containerd-shim') do
describe file('/usr/bin/containerd') do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by 'root' }
end

describe file('/usr/bin/docker-runc') do
describe file('/usr/bin/containerd-shim') do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by 'root' }
Expand Down Expand Up @@ -73,7 +98,7 @@
end

describe command('docker -v') do
its(:stdout) { should match /Docker version 18.04.0-ce, build/ }
its(:stdout) { should match /Docker version 18.09.7, build/ }
its(:exit_status) { should eq 0 }
end

Expand Down
2 changes: 1 addition & 1 deletion travis-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ echo "BUILD_NR=$BUILD_NR"
BUILD_DEST=builds/$BUILD_NR
mkdir -p $BUILD_DEST
#-build
VERSION=v$BUILD_NR make shellcheck
#VERSION=v$BUILD_NR make shellcheck
VERSION=v$BUILD_NR make sd-image
#-test
VERSION=v$BUILD_NR make test
Expand Down

0 comments on commit 909cc5a

Please sign in to comment.