https://d3nmt5vlzunoa1.cloudfront.net/phpstorm/files/2015/10/large_v-trans.png No, this isn't a Steemit whale, it's the Docker whale! from https://www.docker.com/ I'm just going to share with you some basics of using docker. I found it very handy when setting up my Steem Witness node. # What is it? Docker allows you to run a virtual, contained system. It is a little bit like VMWare or Virtual box, except those two emulate computer hardware where as Docker can make use of your existing OS kernel. This makes Docker much more lightweight and lean, but still gives you contained, virtual operating system. # Installing First you have to install docker. I'm not going to go into too much detail for this. If you are on Linux, you can use the package management system and install. For windows, you can get it from here: https://docs.docker.com/docker-for-windows/ Some caveats, you'll need 64 bit windows 10 pro for this, and you may have to go into the Bios and turn virtualization on. # Making sure it works You'll want to run the command `docker info` You should get something like this: `neo@hanxia ~ $ docker info` `Containers: 1` `Running: 1` `Paused: 0` `Stopped: 0` `Images: 4` `Server Version: 1.12.6` `Storage Driver: aufs` etc.. If you don't get this, then something is not working. You may have to start the Docker daemon, and/or put your user in the 'docker' group. The next basic thing you can do is to run a simple container: `docker run hello-world` What this does is to download a simple container and then run it. https://i.imgsafe.org/b8ed7a1b42.png # Image management A docker image is a blueprint for a container. A container is the thing that actually runs. To see what images you have taking up your disk space, do https://i.imgsafe.org/b8db21e344.png You can see here that I have three images. If I want to remove an image I don't need, I can do: `docker rmi hello-world` That will remove the 'hello-world' image. How did I get that "ubuntu 16.04" image? You can do: `docker pull ubuntu:16.04` This image is very useful for compiling Steemd you need for a witness node. # Container management A container is a running instance that is created from an image. Let's say we want to run an instance of ubuntu 16.04 . We can do: https://i.imgsafe.org/b945a66cca.png `docker run --name myubuntu -it ubuntu:16.04 /bin/bash` Ok, I used "--name" to give my container a name. Otherwise docker will give it some funny name. "-it" means to make it an interactive terminal. "ubuntu:16.04" is what image I wanted to run. And of course I want to run a nice bash shell. You can see that I'm "root" in this little system, the hostname is the pithy "92dc248fb1d6" and it has it's own file system. Let's make a tiny change to this running container: https://i.imgsafe.org/b96e378206.png Now it has a "steemit" file... You can exit the shell using "exit" which will also stop the container, but it's still there. Use `docker ps -a` to show all the containers, even if they are not running at the moment (the -a). https://i.imgsafe.org/b9912ccd0d.png We can run a second container from the same ubuntu:16.04 image and call it "myubuntutwo". https://i.imgsafe.org/b9a1f789ce.png You'll notice that it does not have the "steemit" file we added. This is a different container! "exit" the container and list them again: https://i.imgsafe.org/b9b0b966f1.png There is our two containers! Now if we want to get back in our first container, we do: https://i.imgsafe.org/b9ba37b896.png `docker restart myubuntu` `docker attach myubuntu` then hit return. And look, our "steemit" file is back! Let's say you want to open up a second terminal into this container without closing the first one. You can do: `docker exec -it myubuntu bash` https://i.imgsafe.org/b9cf350a4a.png If you have too many containers running and want to get rid of one, do: `docker rm myubuntutwo` This will delete the "myubuntutwo" container, be careful with this sort of thing. Ok, phew, one last command for now, I promise. Supposing we really like the "myubuntu" container we made, with our change to it (the steemit file) and we want to save this as an image, or template for future containers. You can run this command: `docker commit myubuntu neoxian/myubuntu` https://i.imgsafe.org/b9f278fa63.png We have taken the "myubuntu" container and created the image "neoxian/myubuntu". The new image shows up when you run `docker images`. # You now have Docker Kung-fu! Clearly this just scratches the surface of Docker, there is way more to it, and I'm still just a noob myself, but this guide should help get you started. # Happy Dockering! https://i.imgsafe.org/ba02d85c63.gif
author | neoxian |
---|---|
permlink | neoxian-s-guide-to-docker |
category | programming |
json_metadata | {"tags":["programming","docker","guide"],"image":["https://d3nmt5vlzunoa1.cloudfront.net/phpstorm/files/2015/10/large_v-trans.png","https://i.imgsafe.org/b8ed7a1b42.png","https://i.imgsafe.org/b8db21e344.png","https://i.imgsafe.org/b945a66cca.png","https://i.imgsafe.org/b96e378206.png","https://i.imgsafe.org/b9912ccd0d.png","https://i.imgsafe.org/b9a1f789ce.png","https://i.imgsafe.org/b9b0b966f1.png","https://i.imgsafe.org/b9ba37b896.png","https://i.imgsafe.org/b9cf350a4a.png","https://i.imgsafe.org/b9f278fa63.png","https://i.imgsafe.org/ba02d85c63.gif"],"links":["https://www.docker.com/","https://docs.docker.com/docker-for-windows/"],"app":"steemit/0.1","format":"markdown"} |
created | 2017-02-08 22:52:51 |
last_update | 2017-02-09 01:38:54 |
depth | 0 |
children | 4 |
last_payout | 2017-03-12 03:20:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 12.875 HBD |
curator_payout_value | 3.117 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 4,719 |
author_reputation | 167,513,329,359,448 |
root_title | "Neoxian's guide to Docker" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 2,457,914 |
net_rshares | 45,270,956,847,436 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
berniesanders | 0 | 3,439,794,392,424 | 40% | ||
penambang | 0 | 6,055,884,611 | 30% | ||
berkah | 0 | 64,904,643,871 | 100% | ||
proskynneo | 0 | 4,760,670,420,150 | 69% | ||
val-b | 0 | 9,097,185,757,479 | 69% | ||
wackou | 0 | 4,934,569,657,702 | 100% | ||
sandra | 0 | 42,548,057,172 | 90% | ||
kushed | 0 | 2,454,675,070,707 | 100% | ||
nextgencrypto | 0 | 1,492,907,863,745 | 40% | ||
rossco99 | 0 | 130,498,930,380 | 30% | ||
jaewoocho | 0 | 2,570,698,659,109 | 69% | ||
xeroc | 0 | 214,038,938,136 | 30% | ||
steem-id | 0 | 26,855,609,385 | 30% | ||
clayop | 0 | 1,253,402,281,098 | 69% | ||
steemservices | 0 | 8,715,066,805 | 2% | ||
lovejoy | 0 | 22,366,464,479 | 30% | ||
boatymcboatface | 0 | 43,684,725,015 | 30% | ||
pairmike | 0 | 11,042,338,680 | 30% | ||
pheonike | 0 | 11,961,424,829 | 6% | ||
proctologic | 0 | 1,357,802,724 | 2% | ||
donkeypong | 0 | 1,048,364,385,274 | 50% | ||
hcf27 | 0 | 3,188,922,260 | 100% | ||
steemrollin | 0 | 363,635,237,804 | 100% | ||
proctologic2 | 0 | 573,462,139 | 100% | ||
chitty | 0 | 261,297,931,855 | 100% | ||
acidsun | 0 | 20,648,446,897 | 50% | ||
proctologic3 | 0 | 774,387,909 | 100% | ||
jademont | 0 | 3,960,806,162 | 30% | ||
steemship | 0 | 533,563,079,077 | 60% | ||
spaninv | 0 | 1,140,515,701 | 100% | ||
avarice | 0 | 14,947,911,949 | 23% | ||
murh | 0 | 1,356,984,174 | 10% | ||
cryptofunk | 0 | 13,020,139,954 | 84% | ||
blakemiles84 | 0 | 38,099,359,526 | 30% | ||
theshell | 0 | 9,026,162,304 | 30% | ||
justtryme90 | 0 | 232,525,029,326 | 100% | ||
pseudonymous | 0 | 277,394,814 | 100% | ||
michaelx | 0 | 4,341,988,369 | 30% | ||
anwenbaumeister | 0 | 528,859,081,576 | 60% | ||
grandpere | 0 | 35,698,812,773 | 100% | ||
albertogm | 0 | 5,195,997,512 | 30% | ||
tyler-fletcher | 0 | 3,506,203,938 | 100% | ||
fyrstikken | 0 | 56,416,511,298 | 1% | ||
clement | 0 | 5,590,592,638 | 100% | ||
isteemit | 0 | 29,299,277,888 | 100% | ||
skapaneas | 0 | 17,541,624,714 | 100% | ||
grey580 | 0 | 745,944,314 | 4% | ||
thebatchman | 0 | 1,119,883,173 | 3% | ||
asmolokalo | 0 | 159,276,242,038 | 33% | ||
good-karma | 0 | 64,241,453,174 | 43% | ||
roelandp | 0 | 174,602,514,715 | 30% | ||
lehard | 0 | 9,490,209,219 | 100% | ||
neoxian | 0 | 642,514,572,178 | 100% | ||
on0tole | 0 | 8,946,889,565 | 100% | ||
anasya | 0 | 17,512,372,866 | 100% | ||
vl248 | 0 | 8,448,732,342 | 100% | ||
sveokla | 0 | 4,143,448,694 | 100% | ||
marinabogumil | 0 | 5,147,885,496 | 100% | ||
anmuravjev | 0 | 1,314,551,740 | 100% | ||
raymondspeaks | 0 | 1,858,700,140 | 30% | ||
kell234 | 0 | 1,681,127,065 | 100% | ||
thebatchman1 | 0 | 69,194,420 | 3% | ||
allmonitors | 0 | 23,415,045,676 | 100% | ||
hyiparena | 0 | 3,835,912,847 | 100% | ||
shla-rafia | 0 | 5,555,161,686 | 10% | ||
cryptojoy.com | 0 | 299,907,460 | 30% | ||
konti | 0 | 4,723,750,636 | 100% | ||
phenom | 0 | 3,440,808,818 | 30% | ||
opheliafu | 0 | 82,903,219,051 | 54% | ||
fubar-bdhr | 0 | 32,487,362,710 | 40% | ||
sharker | 0 | 7,627,294,059 | 100% | ||
zaebars | 0 | 46,053,222,982 | 100% | ||
jedau | 0 | 5,235,023,931 | 100% | ||
sokoloffa | 0 | 7,062,434,782 | 100% | ||
mondeja | 0 | 3,014,766,244 | 100% | ||
mysteem | 0 | 1,467,475,513 | 43% | ||
crypto.owl | 0 | 6,766,801,044 | 100% | ||
winstonwolfe | 0 | 28,751,830,035 | 100% | ||
nelu.ceban | 0 | 3,330,470,587 | 100% | ||
bkkshadow | 0 | 33,869,528,808 | 70% | ||
smailer | 0 | 41,176,808,552 | 100% | ||
bullionstackers | 0 | 49,815,388,977 | 100% | ||
dmilash | 0 | 13,355,744,445 | 100% | ||
gomeravibz | 0 | 36,479,306,172 | 100% | ||
litrbooh | 0 | 1,933,304,092 | 100% | ||
nekromarinist | 0 | 18,014,867,694 | 100% | ||
merej99 | 0 | 68,511,892,550 | 100% | ||
always1success | 0 | 5,635,601,521 | 100% | ||
timcliff | 0 | 160,854,568,076 | 100% | ||
toxichan | 0 | 1,134,938,143 | 70% | ||
brendio | 0 | 11,824,344,759 | 24% | ||
asdes | 0 | 2,216,246,434 | 100% | ||
timelapse | 0 | 22,250,920,184 | 100% | ||
mama-steem | 0 | 1,313,462,344 | 100% | ||
accumulator | 0 | 1,695,241,507 | 100% | ||
uuuhha | 0 | 10,842,416,913 | 100% | ||
romancs | 0 | 2,512,665,956 | 100% | ||
ipumba | 0 | 2,954,589,143 | 100% | ||
riosparada | 0 | 11,075,724,845 | 100% | ||
bigsambucca | 0 | 286,128,809 | 100% | ||
steemradio | 0 | 258,352,959 | 30% | ||
randyclemens | 0 | 10,225,212,223 | 100% | ||
krishtopa | 0 | 49,485,894,950 | 100% | ||
villainblack | 0 | 5,298,875,906 | 100% | ||
cmorton | 0 | 835,897,155 | 12% | ||
numberone | 0 | 4,725,937,701 | 100% | ||
matrixdweller | 0 | 491,164,160 | 1% | ||
jayfox | 0 | 373,577,892 | 30% | ||
seraph | 0 | 0 | 100% | ||
demo | 0 | 104,464,626 | 43% | ||
jsantana | 0 | 7,512,963,474 | 100% | ||
professorx | 0 | 1,037,723,201 | 100% | ||
imag1ne | 0 | 1,641,496,529 | 100% | ||
shadowspub | 0 | 4,421,425,018 | 30% | ||
leno4ek | 0 | 1,587,421,492 | 100% | ||
franks | 0 | 27,081,046,740 | 100% | ||
nulliusinverba | 0 | 1,177,351,719 | 30% | ||
runridefly | 0 | 13,241,962,568 | 39% | ||
jlufer | 0 | 7,668,193,804 | 100% | ||
shenanigator | 0 | 299,021,595,427 | 100% | ||
randomli | 0 | 1,498,671,020 | 100% | ||
nadin3 | 0 | 5,070,329,574 | 100% | ||
xanoxt | 0 | 19,160,029,479 | 100% | ||
victoriart | 0 | 8,241,524,987 | 100% | ||
l0k1 | 0 | 5,189,532,590 | 3% | ||
maryfromsochi | 0 | 1,797,672,059 | 100% | ||
tatianka | 0 | 1,836,369,295 | 100% | ||
thecyclist | 0 | 1,094,498,891,245 | 40% | ||
zettar | 0 | 1,348,004,877 | 100% | ||
ebargains | 0 | 2,786,997,266 | 100% | ||
elena-singer | 0 | 5,320,274,013 | 100% | ||
renzoarg | 0 | 10,743,645,242 | 100% | ||
finleyexp | 0 | 372,098,090 | 43% | ||
tracemayer | 0 | 6,252,200,832 | 30% | ||
feruz | 0 | 91,899,532 | 43% | ||
burnin | 0 | 11,108,366,236 | 100% | ||
anton333 | 0 | 4,852,956,306 | 100% | ||
steemsquad | 0 | 1,430,451,589 | 100% | ||
pickoum | 0 | 18,173,307,054 | 100% | ||
ekaterinka | 0 | 1,689,230,738 | 100% | ||
bestofreddit | 0 | 4,437,846,195 | 90% | ||
clayboyn | 0 | 34,981,579,088 | 100% | ||
develcuy | 0 | 4,003,418,842 | 100% | ||
lajulius | 0 | 7,078,821,821 | 100% | ||
borishaifa | 0 | 6,257,919,914 | 100% | ||
mapalatv | 0 | 1,047,200,686 | 100% | ||
crimson | 0 | 475,185,649 | 69% | ||
curie | 0 | 389,621,808,635 | 100% | ||
cebymaster | 0 | 5,088,406,625 | 100% | ||
htyfn | 0 | 1,877,438,184 | 100% | ||
rusteemitblog | 0 | 5,558,689,645 | 100% | ||
orenshani7 | 0 | 4,541,776,669 | 100% | ||
therajmahal | 0 | 1,783,274,832 | 100% | ||
hendrikdegrote | 0 | 5,696,880,637,293 | 69% | ||
marel | 0 | 1,144,046,665 | 100% | ||
steemlift | 0 | 2,449,572,751 | 100% | ||
galveston | 0 | 1,595,447,181 | 40% | ||
unhorsepower777 | 0 | 20,483,974,665 | 100% | ||
revostrike | 0 | 209,691,670 | 30% | ||
sherry-dow | 0 | 68,536,653 | 100% | ||
ianboil | 0 | 919,569,712 | 30% | ||
zatrhas | 0 | 1,848,344,001 | 40% | ||
zathras | 0 | 2,910,721,607 | 40% | ||
steemspeak | 0 | 232,903,255 | 1% | ||
fyrst-witness | 0 | 374,954,030 | 1% | ||
max-max | 0 | 2,677,762,086 | 100% | ||
sstefan | 0 | 5,943,582,109 | 50% | ||
lovethepeople | 0 | 130,344,100 | 100% | ||
garvofe | 0 | 5,098,485,293 | 100% | ||
porco-bastardo | 0 | 126,658,094 | 100% | ||
sqube | 0 | 2,958,159,390 | 1% | ||
maxse | 0 | 1,297,600,821 | 30% | ||
catto000 | 0 | 11,008,571,611 | 100% | ||
nikflossus | 0 | 68,553,351,734 | 100% | ||
esteemapp | 0 | 95,402,339 | 43% | ||
chiliec | 0 | 13,311,330,521 | 100% | ||
collabornation | 0 | 1,248,842,898 | 100% | ||
reisman | 0 | 2,418,588,112 | 100% | ||
engagement | 0 | 1,603,774,813,392 | 40% | ||
damiendecoster | 0 | 723,929,614 | 100% | ||
bottymcbotface | 0 | 252,718,593 | 84% | ||
finder | 0 | 445,819,606 | 100% | ||
beeskee | 0 | 3,340,959,779 | 50% | ||
gildar | 0 | 963,365,705 | 100% | ||
killuminatic | 0 | 230,791,308 | 100% | ||
colin-porter | 0 | 787,817,115 | 100% | ||
tamersameeh | 0 | 337,957,437 | 100% | ||
beerbot | 0 | 1,730,672,835 | 40% | ||
stmdxrafi | 0 | 149,161,510 | 100% | ||
personz | 0 | 7,535,969,529 | 100% | ||
melania | 0 | 5,662,811,373 | 100% | ||
kostaslou | 0 | 2,389,599,887 | 100% | ||
rahul.stan | 0 | 320,087,209 | 100% | ||
fisteganos | 0 | 734,679,849 | 10% | ||
dalek | 0 | 190,519,086 | 100% | ||
bounties | 0 | 50,076,284 | 43% | ||
steempoll | 0 | 50,076,173 | 43% | ||
eem | 0 | 117,961,662 | 53% | ||
blockained | 0 | 131,456,779 | 100% | ||
blockchained | 0 | 547,249,863 | 100% | ||
marco.world | 0 | 131,452,354 | 100% | ||
ogochukwu | 0 | 1,290,357,663 | 100% | ||
toyblackhat | 0 | 1,014,007,134 | 100% | ||
tonylondon | 0 | 440,820,106 | 100% | ||
vrezh | 0 | 120,156,731 | 100% | ||
blacklist | 0 | 208,585,299 | 1% | ||
benjiparler | 0 | 305,209,756 | 100% | ||
steemstock | 0 | 114,483,803 | 100% | ||
adminpoly | 0 | 85,166,223 | 20% | ||
steemfeed | 0 | 2,397,816,658 | 100% | ||
amuse | 0 | 364,706,721 | 100% | ||
drakos | 0 | 0 | 100% | ||
vickykumar | 0 | 0 | -100% |
Good to know dockering
author | bullionstackers |
---|---|
permlink | re-neoxian-neoxian-s-guide-to-docker-20170208t232517034z |
category | programming |
json_metadata | {"tags":["programming"],"app":"steemit/0.1"} |
created | 2017-02-08 23:25:18 |
last_update | 2017-02-08 23:25:18 |
depth | 1 |
children | 0 |
last_payout | 2017-03-12 03:20:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.018 HBD |
curator_payout_value | 0.001 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 22 |
author_reputation | 163,180,943,634,376 |
root_title | "Neoxian's guide to Docker" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 2,458,131 |
net_rshares | 655,592,122,434 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
paul-gillbanks | 0 | 852,368,894 | 100% | ||
neoxian | 0 | 629,402,029,889 | 100% | ||
solidgold | 0 | 25,068,728,649 | 100% | ||
watch-chronolog | 0 | 268,995,002 | 100% |
Thanks for the info! Curious, if you are already running an Ubuntu machine, are there any benefits to running everything through Docker?
author | timcliff |
---|---|
permlink | re-neoxian-neoxian-s-guide-to-docker-20170208t230726009z |
category | programming |
json_metadata | {"tags":["programming"],"app":"steemit/0.1"} |
created | 2017-02-08 23:07:24 |
last_update | 2017-02-08 23:07:24 |
depth | 1 |
children | 2 |
last_payout | 2017-03-12 03:20:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.019 HBD |
curator_payout_value | 0.001 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 136 |
author_reputation | 272,954,445,077,789 |
root_title | "Neoxian's guide to Docker" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 2,458,024 |
net_rshares | 642,514,572,178 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
neoxian | 0 | 642,514,572,178 | 100% |
Two advantages: * Security: the container is a sandbox, so if it get hacked, the damage is limited to the container and not the whole system. * Repeatability: with a container, you can have a known system that has everything you need for your application and little to no extra cruft, so you can compile, run and debug your apps in a more consistant way. You don't have to worry about hundreds of different types of linux distributions or windows setups that have become 'unique' over time.
author | neoxian |
---|---|
permlink | re-timcliff-re-neoxian-neoxian-s-guide-to-docker-20170208t231423830z |
category | programming |
json_metadata | {"tags":["programming"],"app":"steemit/0.1"} |
created | 2017-02-08 23:14:24 |
last_update | 2017-02-08 23:14:24 |
depth | 2 |
children | 1 |
last_payout | 2017-03-12 03:20:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.018 HBD |
curator_payout_value | 0.003 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 492 |
author_reputation | 167,513,329,359,448 |
root_title | "Neoxian's guide to Docker" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 2,458,067 |
net_rshares | 685,813,448,572 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
neoxian | 0 | 642,514,572,178 | 100% | ||
timcliff | 0 | 41,824,753,344 | 25% | ||
accumulator | 0 | 1,474,123,050 | 100% | ||
drakos | 0 | 0 | 100% |
Cool, thanks!
author | timcliff |
---|---|
permlink | re-neoxian-re-timcliff-re-neoxian-neoxian-s-guide-to-docker-20170208t231752634z |
category | programming |
json_metadata | {"tags":["programming"],"app":"steemit/0.1"} |
created | 2017-02-08 23:17:51 |
last_update | 2017-02-08 23:17:51 |
depth | 3 |
children | 0 |
last_payout | 2017-03-12 03:20:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 13 |
author_reputation | 272,954,445,077,789 |
root_title | "Neoxian's guide to Docker" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 2,458,091 |
net_rshares | 0 |