-
-
Save manesec/efc649575974f4bc2902a2b338f920af to your computer and use it in GitHub Desktop.
Install Docker on Rocky Linux
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
#!/usr/bin/env bash | |
## Script to install docker-ce on Rocky Linux | |
## Run using `sudo rocky-docker.sh` | |
# Ensuring "GROUP" variable has not been set elsewhere | |
unset GROUP | |
echo "Removing podman and installing Docker CE" | |
dnf remove -y podman buildah | |
dnf install -y yum-utils | |
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | |
dnf install -y docker-ce docker-ce-cli containerd.io | |
echo "Setting up docker service" | |
systemctl enable docker | |
systemctl start docker | |
systemctl status docker | |
echo "Adding permissions to current user for docker, attempting to reload group membership" | |
usermod -aG docker -a $USER | |
GROUP=$(id -g) | |
newgrp docker | |
newgrp $GROUP | |
unset GROUP | |
echo "Install completed, though you will probably require logout/login if the following command fails:" | |
docker ps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment