-
-
Save pascalandy/00ea34660cf9caff42f28d2b5ab86ad3 to your computer and use it in GitHub Desktop.
Install Docker PPA on Ubuntu 16.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOT FOR SHELL SCRIPT, but rather just for quick copy paste | |
# this is a copy-paste version with defaults of the full shell script docker-xenial.sh which is below this one in gist. | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \ | |
mkdir -p /etc/apt/sources.list.d && \ | |
echo deb https://apt.dockerproject.org/repo ubuntu-xenial main > /etc/apt/sources.list.d/docker.list && \ | |
service lxcfs stop && apt-get remove -y -q lxc-common lxcfs lxd lxd-client && \ | |
apt-get update -q && apt-get upgrade -y -q && \ | |
apt-get install -y -q docker-engine && \ | |
mkdir -p /etc/systemd/system/docker.service.d && \ | |
printf '[Service]\nExecStart=\nExecStart=/usr/bin/dockerd -H fd:// --userns-remap=default --storage-driver overlay2' > /etc/systemd/system/docker.service.d/docker.conf && \ | |
systemctl daemon-reload && \ | |
systemctl restart docker.service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# add's docker official ppa package source for Docker engine | |
# does not include docker-compose or docker-machine | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
mkdir -p /etc/apt/sources.list.d | |
echo deb https://apt.dockerproject.org/repo ubuntu-xenial main > /etc/apt/sources.list.d/docker.list | |
# Other Package Branches, experimental gives you extra features that may change in future | |
#echo deb https://apt.dockerproject.org/repo ubuntu-xenial testing > /etc/apt/sources.list.d/docker.list | |
# remove lxcfs, as we don't need it if we're doing docker | |
service lxcfs stop | |
apt-get remove -y -q lxc-common lxcfs lxd lxd-client | |
apt-get update -q | |
# install latest release (main branch) version of docker | |
apt-get install -y -q docker-engine | |
# | |
# FOR PRODUCTION, CONTROL VERSION MANUALLY | |
# | |
# install docker specific ver | |
# we allow held changes here in case we need to rerun, script will still work 2nd time | |
#apt-get install -y -q docker-engine=1.13.1* --allow-change-held-packages | |
# hold to that version | |
#apt-mark hold docker-engine | |
# remove hold later for upgrade | |
# apt-mark unhold docker-engine | |
# see what upgrade options exist | |
# apt-cache policy docker-engine | |
# edit dockerd startup to enable namespaces and ensure overlay2 | |
# note namespace won't work in all scenerios, like --net=host, | |
# but its tighter security so it's recommended to try using first | |
mkdir -p /etc/systemd/system/docker.service.d | |
printf '[Service]\nExecStart=\nExecStart=/usr/bin/dockerd -H fd:// --userns-remap=default --storage-driver overlay2' > /etc/systemd/system/docker.service.d/docker.conf | |
systemctl daemon-reload | |
systemctl restart docker.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment