Tutorial

Create your first decnetralized container

In this tutorial, you will learn how to launch the Busybox public docker image on Planetr decentralized cloud and interact with it using the Planetr gateway CLI interface.

This tutorial is aimed at someone who has basic knowledge of Docker and wants to get a basic and quick understanding of what Planetr is all about. We will not be going into depth about the intricacies of developing on Planetr, but will hopefully satisfy your curiosity so that you will continue your journey!

This tutorial should take you about 10 minutes to complete.

We only expect that:

  • You are generally familiar with software development and command line interfaces.
  • You are generally familiar with Docker and containers.
  • You are open to learning about the bleeding edge of decentralized development.

Let's Begin

On Planetr's decentralised cloud, run a Busybox docker image.

Install and run Planetr Gateway on your computer

To install Planetr gateway on your computer, please read the Get Started section. This can be achieved on a laptop, a desktop computer, or a cloud instance.

Make sure Planetr gateway is installed and running on your computer.

$ planetr -v

Run busybox on Planetr network using dcu-run command. This is similar to docker run command.

$ planetr dcu-run busybox g.micro
INSTANCE ID STATUS TYPE IMAGE NAME PORTS CREATED AT                        
c234uqv2hral761lkpbg Pending g.micro busybox 2021-04-26T10:58:11.938791+05:30  

Please note that the status is Pending. The gateway will attempt to laucnh your instance on the Planetr network now and once done, the status will become Running

You can run dcu-ps command to list all containers and check teh status. This is similar to docker ps command.

$ planetr dcu-ps
INSTANCE ID STATUS TYPE IMAGE NAME PORTS CREATED AT
c234uqv2hral761lkpbg Pending g.micro busybox 2021-04-26T10:58:11.938791+05:30  

Congratulations! You ran your first docker image on the decentralized cloud. Your computer is now running the gateway to the cloud.

Please note that you may not even have docker installed on your computer and the busybox container is now running on a edge node somewhere on the internet. Mostly in some other country!

Now let us execute some busybox linux shell commands. Let us do the classic ls command to list the files in your container. This is similar to docker exec command.

$ planetr dcu-exec c234uqv2hral761lkpbg "ls"
bin
dev
etc
home
proc
root
sys
tmp
usr
var

Thats it! You can execute any other command in the remote container. Try "date" to see system date. Try "ps -eaf" to list all running processes.

Now stop and delete the container. Keeping the dcu running will consume cost.

$ planetr dcu-rm c234uqv2hral761lkpbg
INSTANCE ID STATUS TYPE IMAGE NAME PORTS CREATED AT
c234uqv2hral761lkpbg Deleting g.micro busybox 2021-04-26T10:58:11.938791+05:30 

Thank you for trying the first tutorial. You may continue with more tutorials.


Project source at: GitHub