Libra ❤ Docker

katopz
katopz
Jun 22 · 3 min read

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

For local development purpose

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

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

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

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

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
  • 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
  • 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

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!

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

Coinmonks

Coinmonks is a technology-focused publication embracing decentralize technologies. We are Non-profit and education is our core value. Learn, Build and thrive. Our other project— https://coinmonks.com, https://cryptofi.co, https://coincodecap.com

katopz

Written by

katopz

DLT & ML Debugger

Coinmonks

Coinmonks

Coinmonks is a technology-focused publication embracing decentralize technologies. We are Non-profit and education is our core value. Learn, Build and thrive. Our other project— https://coinmonks.com, https://cryptofi.co, https://coincodecap.com