Last active
January 25, 2022 21:48
-
-
Save kolosek/67a126d52d461c4bf67798737b3598bc to your computer and use it in GitHub Desktop.
Install docker and runner on bare bone Linux 18.04.1 machine
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
#chmod +x gitlab-runners.sh | |
#Set memory allocation for each runner. | |
sudo sysctl -w vm.max_map_count=262144 | |
sudo apt install apt-transport-https ca-certificates curl 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 focal stable" | |
sudo apt update | |
sudo apt install docker-ce | |
sudo usermod -aG docker $USER | |
# Docker-compose | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
docker-compose --version | |
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash | |
sudo apt-get install gitlab-runner | |
gitlab-runner --version | |
echo "In order to register gitlab runners run: sudo gitlab-runner register" | |
### Troubleshooting### | |
## If docker-compose gives permission error, first just try plain restart, then below items: | |
#As second step states. Apply executable permissions to the binary: | |
sudo chmod +x /usr/local/bin/docker-compose; | |
#In addition to the comments provided in the question | |
sudo usermod -aG docker $USER # to add myself to docker group | |
sudo chgrp docker /usr/local/bin/docker-compose # to give docker-compose to docker group, | |
sudo chmod 750 /usr/local/bin/docker-compose # to allow docker group users to execute it | |
#You might want to try running newgrp docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo usermod -aG docker $USER