Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generalized docker install and split apart centos and ubuntu
- Loading branch information
1 parent
bea55f0
commit 22e3d6f
Showing
4 changed files
with
79 additions
and
87 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
if [ "$EUID" -ne 0 ]; then | ||
echo "Please run as root" | ||
exit | ||
fi | ||
|
||
usage="$(basename "$0") [-h] [-u, --user user name] -- | ||
script to setup Docker. Run as root. Think before your type:\n | ||
-h show this help text\n | ||
-u, --user User name that will be running Docker containers.\n" | ||
|
||
while [[ $# > 0 ]] | ||
do | ||
key="$1" | ||
case $key in | ||
-u|--user) | ||
DOCKER_USER="$2" | ||
shift # past argument | ||
;; | ||
-h|--help) | ||
echo -e $usage | ||
exit | ||
;; | ||
esac | ||
shift # past argument or value | ||
done | ||
|
||
if [ -z "$DOCKER_USER" ]; then | ||
echo "Must supply a user:" | ||
echo -e $usage | ||
exit 1 | ||
fi | ||
|
||
service docker stop | ||
|
||
dpkg --configure -a && apt-get remove -y docker docker-engine docker.io \ | ||
docker-ce && rm -rf /var/lib/docker && apt-get update && apt-get -y upgrade \ | ||
&& apt-get -y dist-upgrade && apt-get -y install git unzip wget \ | ||
nfs-kernel-server nfs-common && apt autoremove -y | ||
|
||
curl -sSL get.docker.com | sh | ||
usermod -aG docker ${DOCKER_USER} | ||
|
||
curl -L https://github.com/docker/compose/releases/download/1.19.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose | ||
|
||
chmod +x /usr/local/bin/docker-compose | ||
|
||
service docker start | ||
|
||
reboot now |
This file contains 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