Libra ❤ Docker

0
101

🐳 Let’s try libra client via docker, I’ll provide local macOS, bare metal and docker hub style! Ready? Go!

Build on MacOS

For local development purpose
git clone https://github.com/libra/libra.git
cd libra
docker build -f ./docker/client/client.Dockerfile -t libra_client .

Build on Docker Hub

For build only, you will need to pull to your server or mac for run its later)
https://github.com/katopz/libra
  • Sign up and goto create repository page , Fill in libra_client as name and click create (Ignore build setting)
  • Go to build setting and fill your libra repository
  • Fill Dockerfile location
/docker/client/client.Dockerfile
  • Save and Build and feed you cat (129 minute!)
129 minutes!
  • To use it (on mac or server)
docker run --rm --name libra katopz/libra_client

Build on Ubuntu

For build and run on bare metal, mostly for quick POC or internal use

Prerequisites

  • Server : Use this DigitalOcean link to get free credit
  • Keep alive ssh session

Pro tips

It take more than 80 minutes to build so you can get cut of from SSH pipe, to ensure it won’t happen you will need to keep it alive both client and server

  • On mac
open ~/.ssh/config

And add this

Host *
TCPKeepAlive yes
ServerAliveInterval 120
nano /etc/ssh/sshd_config

And add this

TCPKeepAlive yes
ClientAliveInterval 65535
ClientAliveCountMax 3

Now ssh to your server

ssh root@123.45.678.90 -o ServerAliveInterval=100
  • Install Docker CE

Get Docker CE for Ubuntu

  • Load libra source
git clone https://github.com/libra/libra.git
  • Build Docker image (This take some time, go feed your cat)
docker build -f ~/libra/docker/client/client.Dockerfile -t libra_client ~/libra

Run it

  • To run local libra_client Docker image as libra
docker run --rm -it --name libra libra_client
  • To run remote (from Docker Hub)
Replace katopz/libra_client with your own repos
docker run --rm -it --name libra katopz/libra_client

Pro tips

You can also stdin to docker like this…

echo account create | docker run --rm -i katopz/libra_client
Look ma! No hand! :D

Have fun!

TODO

  • Use docker compose
  • Use docker swarm/K8S
  • Use Cloud Run

To support content like this please feel free to tip me via…PayPal Thanks!

Pay todsaporn banjerdkit using PayPal.Me


Libra ❤ Docker was originally published in Coinmonks on Medium, where people are continuing the conversation by highlighting and responding to this story.