Today on the show I've got Marcus use me. 1
You've seen him before if you watch my YouTube Live. 2
He's over there on the left. 3
Marcus who is one of the co-founders of 4
Play with Docker and play with Kubernetes. 5
If you're familiar with that we talk about that too all the time on this show and in my courses and 6
all the workshops that everyone I know in the captain's community you know always use you using play 7
with Docker to share our examples and to show people cool stuff. 8
So thanks again Marcos for having a lot of beers one night. 9
And you and Jonathan figuring out how to make that thing work in a matter of hours. 10
It was pretty great. 11
And so here we are years later it is these standard tool now for playing around with Docker without 12
having to put it on your own machine. 13
So you're going to show us off some of the the new features that the command line for moving around 14
between different environments. 15
So take it away. 16
Yes. 17
Thank you very much Brad. 18
So happy to be here once again in the show. 19
You said like a happy still colorblind community and people like to get involved with their career you 20
know through playing with alcohol either through a play would get you on notice that it's a project 21
that we started with Jonathan like a couple of years ago 2015 if I recall correctly and it's being used 22
like allowed to steal out we we're having like thousands of visits per day and we are still about anything 23
conferences. 24
So the past Dr. Con in San Francisco all the workshops we're using the underlying infrastructure so 25
we are really happy to go to Cuba hoping and fostering you know the community and people who want to 26
learn especially in places where the the connection is not really good like India. 27
Maybe some other countries people find that really interesting cases to run stuff complete with operate 28
either a containers or maybe mind some bitcoins and stuff but. 29
Yeah. 30
Eric you were saying where there is that stable internet is like or any conference that you've ever 31
been to. 32
That is correct. 33
It really helps us a Duggar gone to because we got hundreds and hundred hundreds of people all at the 34
same time using play with Duggar. 35
Yeah I went running a workshop at Dr. Khan and we we were trying to download a dot net container image 36
and it just it was just killing the wife. 37
So someone suggested we play with Walker and of course you know within an instant it was able to pull 38
this of. 39
So yeah yeah they keep promising that the next gen Y Fi is gonna allow multiple connections instead 40
of one person talking at a time it's gonna allow a bunch of different people talking at a time to the 41
same IP so maybe that will be the future because every time we upgrade our Wi-Fi and cellular always 42
like okay no conferences are no longer a problem. 43
And then there's still a problem. 44
So yeah there's something there's always something right. 45
Yeah. 46
So anyways back to the contact switching. 47
So Joel actually made like a good introduction like the way that they're using it for UCB and that plus 48
three elements. 49
So I'm going to share my screen now I'm going to try to explain how that was edited a bit in depth. 50
So let me try to. 51
I think I can share because you already have the screen right. 52
Oh Joe you still sharing stuff. 53
Maybe I'm not sure how that works. 54
I'm drinking my day by the. 55
I'm basing what I just haven't seen. 56
As you know 57
the mighty man area I stopped. 58
Let me see if this lets me share not just great. 59
Yes I have it now. 60
So you should be able to see my screen now can you say to again. 61
Yeah. 62
Okay. 63
So I mean my terminal and the first thing that you're going to see in the new doctor 99 three is the 64
doctor context going on right. 65
So the doctor context come on it it basically allows you to do like little things. 66
So it allows you to create a context export and import context these are very much straightforward. 67
I'm not gonna go into this once. 68
I would like to display the constant add context list all the contacts that would have delayed update 69
and use context. 70
So the first thing that I'm going to do is I'm gonna basically do double context. 71
Let's see what we have in our lab. 72
We know basic Docker installation. 73
So basically you're gonna see that you have one context by default which is the default context. 74
And he basically points through your Unix the main target in the machine in this particular case. 75
It's also it also has like a Q and it is a endpoint because I have a cube configured my computer right. 76
If you don't have a QCT L or anything this will show like empty. 77
But in my particular case I'm using units were for my daily work which by the way I work at a site which 78
is a cloud service as a platform. 79
And I we use units regularly and doctor as well. 80
And as you can see my prompt I have computed my degree is conducted. 81
So that's why it shows you in the community. 82
So if you use your net is Docker context automatically like integrates with that and he will allow you 83
to deploy your Docker while closing your analysis. 84
That is the way that you want it do. 85
So I use that for context so I can do Docker yes it will be using my local demon. 86
But now let's say that I want to connect to another Docker demon right. 87
So the way that we did it the way we did this in the past is plagued by setting the doctor host environment 88
or variable like this. 89
Yeah we could use lag DCP so maybe whatever 2 3 7 6 PDC SSL endpoint point six and then. 90
Yes. 91
All right. 92
This will tell that that it can connect. 93
So we had an update on commands or we had to like have a bunch of different windows open with different 94
environment variables each. 95
And it was always weird to figure out which one you were on and yeah is it right. 96
But yeah that could be could be I'd work for it but it could be better. 97
I mean especially now that unity allows like easy contact switching like if I do for example queue CDL 98
CAD config get context you can see that I have a bunch of contexts in my computer so I can like can 99
see we have several regions in my company so I can actually go ahead and switch it to any context and 100
basically run it any commander. 101
So it would be nice to do the same thing with operator. 102
So with the double context command I can actually do that now. 103
So what I'm gonna do now is I'm going to go to play with Docker and I'm gonna create an instance where 104
hopefully this site works. 105
It doesn't matter if you don't see it in the browser because I'm just creating a play with a terminal 106
here and I'm just going to copy the euro of the session of that daemon basically. 107
So this is the crossover associates you are all right. 108
So if you're on play with Docker you see that little SSD you are all in the interface. 109
Yes that's correct. 110
So this is the little. 111
Let me try to add some something today so this is the easiest you know but I'm just gonna copy the whole 112
thing here. 113
I don't mind the to the stage come at some I copy the these is commands. 114
So what what I should be able to do here is I can set up Dr. Holst equals DCP right like the traditional 115
way to reason and try and I should be able to do. 116
Dr. Pearce right. 117
So here as you can see I did it on purpose but pointing my local slide to the play with a demon. 118
So if I do for example the Garan I'm going to just run and X and expose it full support these container 119
is gonna be running on my plate with operations. 120
So if I go to my break ground you can see that the board got its pulse here because I'm pointing to 121
the local level and of course I'm going to be able to access the Internet service and I suppose that 122
easy would play with her anyways. 123
What about if I don't remember the IP or as you said Brad if I have like multiple context or multiple 124
sessions and I need to start playing with this like a better right. 125
Like you know in a different way. 126
So what I'm gonna do is I'm going to copy this URL and I'm gonna use the new double context command 127
to actually say this context into my local limit. 128
So I'm going to do double context create and we're going to see a little bit what the options here are. 129
So basically you can contribute a context for both Docker and points and QNX has a points as I showed 130
earlier. 131
So whenever you set a great point you can either like configure the code name which is the one that 132
we're going to use now you can copy the context information from another context and that's something 133
that I also want to show. 134
And of course you can set up their certificates because if you want to talk to her like and this is 135
a live on. 136
You need to specify the certificates as well and you have an additional option to keep their verification 137
in case you don't have like trust and certificates. 138
Same applies for communities you can either import the humanities option from a different context you 139
can use a Q config file where all the certs are there and then you can override the curious context 140
and the communities namespace because whenever you set up a context you need to tell the doctor context 141
OK and let's talk to this community same point but I'm going to talk to these specific communities context 142
and curate its namespace writing code. 143
And here are some examples of how to do it. 144
Are you following tapas. 145
Yeah nice. 146
So now we're going to create a context like a symbol that would conflict. 147
So I'm going to do Docker context create and I'm going to basically set up a local context and for this 148
I'm going to say and I'm going to use the host and I'm going to just paste did I correct. 149
No I didn't. 150
I'm gonna paste the link with upper end point which I'm going to copy now. 151
So let me try to see the context and then clear this double context create Docker prompt a host. 152
I'm gonna paint this and I'm going to name this context because in this context is gonna be called Play 153
with opera as you can see Dublin content says that it created the context. 154
So if I do local context the less now I should be able to see the default context on the play with ochre 155
1. 156
So now what I can do is like a little dog and context use to switch by context and I can say OK I'm 157
going to use the play with uncut context now and I can do. 158
Dr. Yes and I should be able to see the engine container running which is running here in LA with obviously 159
sport. 160
So if I do Docker let's say our M F this container which is running on with ochre you're going to see 161
that the container got killed. 162
So I do Dr. Pearce here. 163
I don't see anything running saved. 164
So this is how easy you can actually connect to a different context and manipulate your containers running 165
there with a double context command like in a two or three steps the three steps is super easy. 166
Yeah. 167
Is that is that in the background actually changing the environment variable for Doctor host or is it 168
just now that the command line is always looking at that those config files to see which one's current. 169
Good question Fred. 170
So how all this works. 171
So like this the same thing has everything. 172
Everything else works in Docker. 173
What this does under the underneath his like it goes through your Docker like a computation folder and 174
it will create a new follow that is called contexts in this particular folder you have a made up folder 175
where you have like a hash of the context that you created in this in this particular path they're going 176
to see and made other Jason File and this Jason file actually has all the information required for the 177
Daemon to connect. 178
So whenever you specify context what what this is doing underneath is like reading that file getting 179
the whole name of the of this file and then sending this whole thing through the local CLIA So it connects 180
to the remote daemon basically. 181
So it's not set it's sitting a like a variable but it's just reading this file and injecting them in 182
the underlined obviously scale basically yeah it's cool does it does. 183
I mean it is a random question now I've got a bunch of thoughts here is that if you if you end up setting 184
the doctor host does that win. 185
Is there a zero I can fight against each other what was the question sorry. 186
Oh well I'm just thinking like it because you previously you said a darker host environment variables 187
so if that's already set does it win over context or that's a good question. 188
I said it would win but we could slide out so let's say local context alas doesn't context. 189
So I mean the play with overall context let's try to override this. 190
Let's try to use for example my local machine uniques. 191
Is three or four right. 192
Wow. 193
And I was gonna say even if it was wrong you'd know think is it would give you an error just right away 194
it would say yeah that's right. 195
Right well we can do it. 196
OK. 197
Yes. 198
That's a. 199
And yes he'd overwrite the count. 200
Yeah. 201
Okay yeah. 202
So it's kind of like it gets the nice thing here is a basically it's not going to break. 203
Like if you have an existing workflows that are depending on an environment variable it won't break 204
them. 205
It'll only work I guess when that one's either empty or are not set or something. 206
Is there a way to use context in like we do with Cube control where we can specified in the command 207
line or do we have to set it first and then like for example. 208
No there is. 209
So I can actually there's a doctor I see. 210
So you can go doctor just see default. 211
Yes. 212
For example and this will talk to my is it context maybe the her context default X I'm sorry. 213
I think it's def just context and then yeah but just content. 214
Default. 215
Yes. 216
Yeah. 217
That is the idea. 218
Yeah. 219
I think it's actually as well. 220
Yeah. 221
Yeah okay. 222
So you could actually default on the commands. 223
So expect yes or whatever. 224
And this basically overrides the the context that you're upset by by default. 225
Yeah. 226
That's really that's handy. 227
So you're using both of them integrate this because actually because let's say that you want to run 228
a container in the context that you have because you want to sound like a troubleshooting shop job or 229
whatever like brand something you can do for C E and alter context unless let's ask you the same the 230
same thing. 231
Yes. 232
Do for example and then you can do Docker. 233
That's the context. 234
Yes for example. 235
Yeah. 236
So this is basically yeah. 237
If you run these it's gonna like loop through all your contacts and run a command through your although 238
all your policy lies basically. 239
Yeah. 240
That's. 241
Which is which is we go say so I had the up in both of my containers so I can do. 242
Iran hello world and this will run hello world in my machine and he will ruddy also play with. 243
Yeah. 244
So that's a protip for those of you that haven't heard it on either the show or wherever we as we talk 245
about we talk about command stuff that in any of the darker. 246
Well not all of them but a lot of the darker commands a dash Q for quiet actually allows you to do these 247
really nice little one liner bash scripts and stuff because it really pumps out just the ideas or the 248
thing you need in order to talk to them. 249
So it's great that I would have never thought of using it with context. 250
That's a really cool cool scenario or you know and you get into those obviously. 251
So yeah. 252
It's the name of the company. 253
So I can just easily look through that and then run something in parallel through all the glasses that 254
I have which is pretty cool. 255
The last thing that I would like to show you is one and one another thing which is pretty recent in 256
dogma is that you can actually ask a question for you or for the audience that you might know already 257
so which is like they're the best way to connect to remote agreement securely. 258
Well previously it was TCB right. 259
Soupy would tell us. 260
But right that there's a nucleus there's a new player. 261
That's a new thing that's a new thing which landed on 18 or nine and now it has been like enhanced by 262
the 19 or three which is SS age basically connection remote connection threads through the ceiling. 263
So how does that work. 264
So pretty much everyone here like before actually installing doc in the world need to provision a machine 265
right so you need to launch a machine in any cloud or whatever and then you need to a cessation to a 266
machine to do some stuff. 267
So in this particular case I already have a machine running in the cloud so I'm going to search through 268
it by using my God and stage config file. 269
Right. 270
So for those who don't know that I know what this file is basically in your in pretty much every configuration 271
you have a config file that basically lists all the machines that you have in remotely. 272
So this is a public IP and this is the key that I'm using to access a machine. 273
So by having this I can easily access that machine by using a stage it only as laughs last jump jump. 274
So basically SSA will read that computation file and it will just connect with that machine right directly 275
by using all the parameters that I have there the public IP the keys and everything. 276
So one nice thing nice thing that dollhouse and it's specifically done with context is that I can say 277
the context create and I'm going to name this context as a sage. 278
And when it created a context again and what we can do here is in host we can actually use MSHA and 279
we can use the name of the config calls that I have in my files so I can do it all yes. 280
Love last jump here. 281
Right. 282
And that's pretty much it. 283
So now I can switch tracks to that context double context use at this age and I can do it again. 284
Yes let's do the Koran work here. 285
Table 286
so what this is doing this is connecting. 287
I'm not sure what's happening here. 288
So this is connecting through the remote or to the remote agreement through its message not through 289
till s and it is running the container there. 290
So I don't need to like either expose Docker ports to the world. 291
I don't need to set up any such certificates or any CAC or whatever this is just using like plane as 292
I said connection made the way that I usually go to that servers. 293
So now that I mean the server here and the pain in the bottom I can do the previous touch a and you 294
can see that they're in a world container just run there which is pretty pretty amazing because I don't 295
need to do any extra steps or whatever anymore. 296
One last comment about this is that you can actually do it without like you can actually use it today 297
if you don't have like 19 0 0 3 by setting up the doctor host to at stage you're going to either use 298
a name that I or that I use here or you can use like user add IP for example right. 299
Yes I can. 300
I can do the same here. 301
Same here. 302
You just need to make sure that the keys you're using it this way you just need to make sure that the 303
keys that this user has are already in your situation because otherwise you will not know which keys 304
to use basically connectivity simply. 305
Yeah. 306
If I remember correctly this method doesn't work yet. 307
If you are using password based SSA which none of you should be but that's still true. 308
I don't think they've changed that. 309
Yes that's correct. 310
This would only work if you're using like a key based access right. 311
Which which we should all be using. 312
I mean you can obviously use password to get a key into the accepted keys list but this is really cool. 313
And when it first came out last fall I would just shut up about it like I was telling everybody like 314
it was. 315
It was the solution to all problems. 316
And so many people I think are basically to me what the SSA ability in context just makes it even easier 317
to use because basically we can now I can never remember what's in my SSA config file right. 318
There's so much stuff in your associates config it's like yeah I can never remember all the things in 319
there. 320
So having it in the context list means I don't have to leave my Docker command line remember okay what 321
was the name of that server that I called it in essence H. 322
But to me what this is going to do is this this is really gonna help us prevent Docker from people from 323
inadvertently exposing unsecure CCP connections or insecurities to be connections on their knock engines 324
because that does get a little bit of heat. 325
Right. 326
Like we we we have had people that there have been reports that Docker is exposed on the Internet or 327
company is exposed on the Internet. 328
And I think that a lot of that has to do with you know people basically doing this like they need a 329
remote to a server. 330
They don't want SSA. 331
So they do that CCP way and now you know as of eight months ago really we don't need that anymore we 332
have this SSA ability and the context makes it even easier. 333
So I'm sorry I switch away from your screens screen share where you done there just one last thing that 334
I want I'll show you. 335
Let's say that you want to create a context for and it is but you still want to use like your regular 336
doctor stuff like your regular doctor context. 337
You can just use one plug from local content create which is this is taking so long because my local 338
see lights blinking to my SSA chair right out here in remote Serbia. 339
Yeah. 340
One one nice feature that I had that I would like to see is that there's a blog for example for communities 341
that brings the context that you're using it would be nice if we can have like a doctor prompt also. 342
So it tells you in which double contacts you are. 343
So eventually is there was there a way to return current context and then. 344
Yeah. 345
You do take into context the less this will tell you the quantitative easing has to start here. 346
So I don't know if there's a way to tell. 347
Give me the current context because of it. 348
If you did I was just thinking this I was actually thinking it would be called this out a one liner 349
on how to add here bashers this age profile. 350
Yeah. 351
Very very content in there. 352
But it is still a nose. 353
There should be a way to know which content seriously. 354
Yeah. 355
We need to we need to see how this CIA actually doesn't like the current bird. 356
Yeah yeah. 357
Because security is has. 358
But I don't know if you can do it without or maybe Jonas. 359
It's a good idea. 360
I like this and I'm curious if there is a way to filter. 361
I mean you can grill but nice. 362
So joyously looking at look it up for us. 363
In any case is going to say it would be cool yeah if we had like just a separate command that we could 364
pipe and we could throw into a there that would just return the name instead of a second extra late. 365
Yeah yeah. 366
So the way that I want to get the LSD. 367
Well else that you might give you go all of them. 368
Yeah I would give you all of them. 369
Oh so I just saying. 370
So do a dash Q And then a filter on maybe there's a filter on current. 371
I think you do have a filter here. 372
Yeah yeah. 373
Just format anyways. 374
Yeah. 375
Yeah. 376
OK. 377
So what I wanted to show is let's say that you want to create a new context. 378
They occur let's say context create and then I'm going to set up like Unity's units just like config 379
file or something. 380
There is a com videos create I don't do this regularly a lot. 381
So you can say community sampling here and then you can say copy failure so you can. 382
Let's say that I want to use curious config file some file some file and then I will reuse the docker 383
context or I'm using my default contacts for example because I don't want to like set up the whole scanning. 384
So what I can do is I can set up like Dr. Douglas Tucker and I can tell this guy from default. 385
And this default is like another contact that I have. 386
And I need to specify it which I didn't do. 387
It's not Cuba. 388
That is I was at the same table and let's create like a desk. 389
So what this is going to do it is gone. 390
This is going to create a new context. 391
But you'll find part doesn't matter. 392
This is going to create a new context but it's going to reuse their doctor information that I have in 393
my default context I can remove the current part just to try and works 394
and this basically context was created. 395
So if I if I do Doctor context use test and I do Dr. Pierce this will talk to my local Lima because 396
I contribute to local context use the same context on the people context basically which is my local 397
machine. 398
That's also a pretty neat addition that you can like easily alias that either the doctor curate its 399
context from a different animal control that you have in your machine. 400
Yeah so that's pretty much what I want to know today. 401
Like lots of interesting tooling around like fiddling with democracy like when you set the darker context 402
is that also set the context for cube control is a totally separate No. 403
That's a totally separate thing. 404
OK that would be cool if that was an option to have the doctor set the cube control for you. 405
So you had a one liner for everything. 406
Because usually when you change Doctor contacts you usually want both to be talking that same server 407
like a a dash a dash K which also includes the context change for Cuba. 408
Maybe that's a good idea. 409
I've already got a thousand features we need to add to this and it just it just showed up. 410
But you know we we need we need version to now biodegrade and by the way. 411
I have the answer to the questions got in the current context that he selected. 412
Yeah. 413
So if you go to yet your config that general updates on file which I'm not going to stop because it 414
has my keys. 415
There's a value in that Jason which says current context I never wanted to name that the context so 416
there's a way to know. 417
Yeah so there's a config so for those you don't know. 418
Actually I can show Monroe quick. 419
So people. 420
Yeah. 421
Let me I can I can show my comment by my my the caller ID like. 422
Okay I got it I got yeah because mine is using the Mac Store so it doesn't have to have the key in there 423
yeah. 424
So yeah basically if you're not familiar your command line on any Docker command line has a config file 425
that controls how your your command line is working or. 426
Yeah. 427
And so there's cool things that have been added lossless that's actually been added in the last year 428
to this because you now can define when you're doing Docker like Ducker stack commands. 429
You can actually deploy those stacks now to Cuba. 430
So there is such a thing as a stack default stack orchestrator so you can you can say I want Cuban entities 431
when I do a darker stack deploy to actually talk to Cuba. 432
Nettie so that's a pretty cool thing most people don't know about that but yeah. 433
One of the things here would be a default context which I don't have one set because I just installed 434
the brand new 1983 release and it wiped out my config because I had an old beta. 435
So yeah that would normally that would be stored in there. 436
And yeah yeah there's a lot of Gothic ski there that has the name of the complex Yeah. 437
If it's apps and I think it's because it's using the default you are some simple script and you'd probably 438
get the current context is we but that's a I'm sure that someone that's watching live or in the next 439
20 minutes on Twitter will give us a one liner that uses JQ with pulling out this Jason File and finding 440
the default context and putting it in every shell command so make it happen Internet. 441
Well thank you so much gentlemen for joining the call today.