Steemd built in a Docker container using Gentoo as a base with -Os optimisation on the system core
howtoยท@l0k1ยท
0.000 HBDSteemd built in a Docker container using Gentoo as a base with -Os optimisation on the system core
https://l0k1-smirenski.github.io/docker-gentoo-steemd/ <sup>(I just discovered I can theme my repositories, so as usual I am picking the dark, scary hacker/matrix style :)</sup> <div class="pull-left"><h1>I</h1></div> <br />finally finished getting `steemd` to build inside a Docker container built on a Gentoo base. The point of this was partly for the optimisation, but also because now, contained in the Dockerfile I created, is all the commands you need to build `steemd` on Gentoo. I unfortunately was not able to use the built in `boost` package within Gentoo, and I have not tweaked either `boost` or `steemd` to have the same optimisation flags ( `-Os` compiler flag is a safe optimisation setting for `gcc` that reduces the memory footprint of the code, which helps on lower memory systems and also improves cache hits inside the CPU thus the improvement in performance). Here is the `README.md`I wrote for the git repository: # docker-gentoo-steemd `steemd` built inside a Docker container using a Gentoo base with size optimization In the `dkr` directory is a short shell script that sets some handy aliases, which you will need to run this docker container: cd dkr source init Then you can type `halp` and it will show you the short commands to perform all the functions: dkr "sudo docker" .run "sudo docker run -v ~/docker-gentoo-portage/data:/work -d true --name docker-gentoo-portage -t docker-gentoo-portage" .enter "sudo docker exec -it docker-gentoo-portage bash" .log "sudo docker logs --tail 30 -f docker-gentoo-portage" .stop "sudo docker stop docker-gentoo-portage" .rm "sudo docker rm docker-gentoo-portage" .build "sudo docker build -t docker-gentoo-portage ." I usually string these commands together when I am developing the Dockerfile, so to build it, if it was already built and you have changed the Dockerfile, you will need to run it like this: .stop;.rm;.build which will stop the existing one with the name (by default in the init file, it is `docker-gentoo-steemd`), remove the FS layers and start a build. By default it starts up a No-Op command so you can manually enter to start up `steemd`, but you can change this to automatically start steemd in the last line of the Dockerfile. To run and enter the container: .run;.enter The data directory contains a volume that is mounted inside the container as `/work` which I have done so you can easily import `block_log` files or even the whole `blockchain` folder inside `witness_node_data_dir`. However, note that this by default will build v0.17.1 so an older `shared_memory.*` file will not work. The other advantage of this arrangement is that even if you delete the Docker container, you won't lose the block_log and configuration files. If you build and then enter and run `steemd` it will function as a seed node only, but the config.ini does not specify a listen port (it will pick a random high port) nor is the Dockerfile configured to forward any ports inbound. However, it should be possible to have it replay, or sync up to date, and then you can stop it and add a witness account name and signing key. This is a super simple, minimalistic docker container, designed in the way that *I* do things, which is usually different to other people. I think it is simpler and more efficient. The configuration of the Gentoo system inside the container is built with `-Os` compiler optimisation flag enabled, so that most of the support libraries are probably smaller and faster than the ones that the host system ould use. Neither Boost nor steemd is optimised this way, however. I may amend this in the future, but for now, this container is fully working and has a side benefit that following the commands inside the Dockerfile you can also build `steemd` to run on a Gentoo server. <div class="pull-right">๐</div><br /><hr /> <center><code>We can't code here! This is Whale country!</code></center> <div class="pull-left"><a href="https://steemit.com/@l0k1"><img src="http://s20.postimg.org/igf27v79p/signature_new_small.png" /></a></div> <h2>Vote #1 <code>l0k1</code></h2><sub>Go to <a href="https://steemit.com/~witnesses">steemit.com/~witnesses</a> to cast your vote by typing <code>l0k1</code> into the text entry at the bottom of the leaderboard.</sub> <sub>(note, my username is spelled <code>El Zero Kay One</code> or <code>Lima Zero Kilo One</code>, all lower case)</sub> </div>
๐ koskl, velourex, lighteye, inphiknit, alktoni, l0k1, greatdabu, lordemau, deanliu, oflyhigh, ardina, fishingvideos, steempowerwhale, fyrstikken, michaelcorleone, juniper, properremake, firaga, fireworks, discipline, coonhunter, poiplu, cloudstrife, steemonme, leaderofleaders, barneyrubble, laoyao, etotheipi, centeredsoul, rightrythm, ted1984, smokinhot, chadmoore, batonrouge, svamiva, onlygooddeals, enrichened, barretwallace, dontbetrippin, glenyven23, windows23, steemquotient, alphalion, moonlanding, loudnoises, smoothcriminal, eternalfreedom, steemitalpha, lockandkeys, sweetonion, copyandpaste, juices, countdracula, pawntod4, vi1son, undertale, maxedoutstats, slider2990, dunia, steemit79, brianphobos, angel76, coininstant, jsantana, honusurf, shaunmza, penguinpablo, oaldamster, giantbear, jamesjarman, andrei, meysam, daisyd, seablue, mycryptomark, proctologic, youngkim, pairmike, willsplace, richardcrill, gomeravibz, ambyr00, steemitguide, juvyjabian, jacobts, mindhunter, cwatch, dirty.hera, surpassinggoogle, stray, patelincho, konelectric, herbertmueller, nang1, barrydutton, steemer0815, darthnava, dresden, steemitqa, forrestwillie, driptorchpress, lasseehlers, timelapse, shadowspub, riskdebonair, whatageek, rok-sivante, wingz, everythink, magnebit, riscadox, robrigo, freeyourmind, biophil, bergy, snowflake, philipnbrown, ethansteem, sharingeverybite, shenanigator, ballinconscious, thetruthhurts, hardank, hopehuggs, ozymandias, ergoproxy, valth, someonewhoisme, mage00000, sixexgames, masteryoda, pal, fiveboringgames, reisman, bestofreddit, thesteemawards, cgame, smalltalk, karenmckersie, taskmanager, d3nv3r, bidnat, renzoarg, viktorcapulet, commenthunter, prizeportal, trans-juanmi, dailybitcoinnews, transhuman, juliosalas, uwe69, allyouneedtoknow, ocrdu, personz, felixxx, faddat, tradeqwik, rossenpavlov, skapaneas, gutzofter, slowwalker, trendwizard, butan, resnullius, seb, saarman, kenny-crane, markush, neoxian, xanoxt, benjojo, paul-gillbanks, voluntary, breezin, fbarry, kview,