DEV Community

Cover image for Install Docker (Compose) on Oracle Linux 8
Kyle Schwartz
Kyle Schwartz

Posted on

Install Docker (Compose) on Oracle Linux 8

Welcome! I couldn't find a simple, straightforward tutorial on how to do this. Everything written here is a summation of the Docker documentation on CentOS, as that is what OL is built upon. I will be using Oracle Linux 8 build 2020.12.17-0, for reference. Now, on to the tutorial!

Installing Docker Engine

First, install yum-utils

sudo yum install -y yum-utils
Enter fullscreen mode Exit fullscreen mode

Next, we add the Docker repository

sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo
Enter fullscreen mode Exit fullscreen mode

Now, we can install Docker. Answer y for all prompts.

sudo yum install docker-ce docker-ce-cli containerd.io
Enter fullscreen mode Exit fullscreen mode

Lastly, start Docker

sudo systemctl start docker
Enter fullscreen mode Exit fullscreen mode

Optionally, run the hello-world image to make sure everything works

sudo docker run hello-world
Enter fullscreen mode Exit fullscreen mode

Installing Docker Compose

First, download Docker Compose

sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Enter fullscreen mode Exit fullscreen mode

Add execution perms to the download

sudo chmod +x /usr/local/bin/docker-compose
Enter fullscreen mode Exit fullscreen mode

Lastly, we need to link to the docker-compose command

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Enter fullscreen mode Exit fullscreen mode

Now, everything should work. Run docker-compose --version to confirm.


And that's it! Easy, right?

Thank you for joining me on this adventure and I hope this was some help!

Top comments (0)