Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added hosts-setup.sh #908

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions docker-deploy/hosts-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /bin/bash
### Group, user and folder creation
## Add docker group if not exists
echo "Adding group 'docker'"
groupadd -f docker
##
echo "Add user 'fate'"
useradd -s /bin/bash -g docker -d /home/fate -m fate
## Set the password
echo "Set password for 'fate'"
passwd fate
mkdir -p /data/projects/fate
## change ownership
chown -R fate:docker /data/projects/fate

#### (Re)Install Docker with latest engine and compose plugin
## snap is not suitable since it requires docker-compose.yml file on Home tree
## apt version does not support composer plugin (may be for Ubuntu 20.04) but this causes denial of "docker compose"
## form present in FATE scripts and allows only "docker-compose"

# remove the existing docker and compose
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
sudo snap remove docker
#sudo snap remove docker --purge //to save time by avoiding saving the snapshot


sudo apt-get update
sudo apt-get install ca-certificates curl gnupg

#install keys for repository
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

#add repository
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

#update and install the latest version
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Loading