Skip to content

Commit

Permalink
Fix docker installation for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
feiskyer committed Mar 14, 2019
1 parent e392824 commit 0651ca7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go
sudo: required
dist: trusty
dist: xenial

go:
- 1.11.x
Expand Down
28 changes: 18 additions & 10 deletions hack/install-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,27 @@ set -o errexit
set -o nounset
set -o pipefail

# Workarounds for error "Failed to fetch https://packagecloud.io/github/git-lfs/ubuntu/dists/trusty/InRelease"
# TODO: remove it after the issue fixed in git-lfs.
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157

# Install docker.
sudo sh -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main" > /etc/apt/sources.list.d/docker.list'
curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
sudo apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-get update
sudo apt-get -y install "docker-engine=17.03.1~ce-0~ubuntu-$(lsb_release -cs)"

# docker debs don't support seccomp, so we install a static version instead.
curl -sSL -o docker.tgz https://download.docker.com/linux/static/stable/x86_64/docker-17.03.1-ce.tgz
tar xzvf docker.tgz
sudo cp -f docker/* /usr/bin
rm -f docker.tgz
sudo apt-get install -y\
apt-transport-https \
ca-certificates \
curl socat \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
# Docker is downgraded because exec process in 18.x doesn't inherit additional group id from the init process.
# See more details at https://github.com/moby/moby/issues/38865.
sudo apt-get -y --allow-downgrades install docker-ce=17.06.2~ce-0~ubuntu

# Restart docker daemon.
sudo service docker restart

0 comments on commit 0651ca7

Please sign in to comment.