DEV Community

Hari Bantwal
Hari Bantwal

Posted on

Dockerize an OCI Instance

"Docker undeniably stands as one of the most versatile tools in any engineer's toolkit. Its utility is akin to that of a Swiss army knife, and its constant evolution through community contributions only bolsters its strength.

Deploying software with Docker on your local machine has become a breeze lately, thanks to its seamless packaging. Familiarity with your local environment makes this a convenient choice. However, when the time comes to self-host an application on a cloud provider, the landscape becomes vastly different, and a multitude of challenges emerges.

In this blog post, we will delve into the installation of Docker on an Oracle Cloud Infrastructure (OCI) instance, laying the crucial foundation for our upcoming ventures. This article is part of an ongoing series, so stay tuned for more insights and practical tips.


Objective: Provision Docker Instance in OCI, with external Block volumes to cater to Docker Services


  1. Provision an OCI Instance. Refer OCI Instance with External Volume

  2. SSH to the Created Instance to install Docker and Docker Compose

sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
sudo dnf list docker-ce
sudo dnf install docker-ce --nobest
sudo docker -v
sudo systemctl enable --now docker
sudo systemctl status docker
sudo usermod -aG docker root
sudo systemctl disable firewalld
sudo sudo curl -L "https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo sudo mv /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose
sudo docker-compose -v

Enter fullscreen mode Exit fullscreen mode

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (2)

Collapse
 
jackattack2022 profile image
abrittaf

I guess you don't need to install docker-composer apart from docker. AFAIK you can simply use

docker compose
Enter fullscreen mode Exit fullscreen mode

command.

Collapse
 
paihari profile image
Hari Bantwal

@jackattack2022 . Yes. in this case though, had a to host few services from docker-compose.ymls. So needed that extension

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay