text
stringlengths
0
2.46k
[2802.36 --> 2805.54] And essentially you're spinning up a Docker image if you're doing local environment stuff.
[2805.66 --> 2812.92] So if I'm doing this locally, this lets me spin up a Docker image that has this environment baked into it.
[2813.06 --> 2817.78] When it comes to using VS Code or a different text editor, whether it's Vim or whatever,
[2817.90 --> 2822.66] you have port forwarding for going into and out of the container so that I can run the application.
[2822.66 --> 2832.20] Let's say it's on port 4000, like any typical web application that's a like 5432 or whatever for the SSL version of the application.
[2832.34 --> 2833.16] So that's how that works.
[2833.22 --> 2833.96] You spin up a container.
[2834.94 --> 2838.08] Your editor is still editing the code, but it's inside.
[2838.76 --> 2840.42] Is it inside that container?
[2840.56 --> 2841.42] Is it just running it?
[2841.48 --> 2842.22] Like, how does that work?
[2842.36 --> 2843.72] Give me, break it down.
[2844.38 --> 2844.58] Yeah.
[2844.84 --> 2849.84] So essentially everything you're doing is living in that container you can view it as.
[2849.84 --> 2855.64] So you could view it as like kind of our model for remote development and VS Code in general.
[2855.84 --> 2860.30] Like you're really working in that remote environment, whether it is a dev container,
[2860.50 --> 2867.08] whether it is the Windows subsystem for Linux, whether it is a remote VM or desktop machine via SSH or tunneling.
[2867.56 --> 2871.96] And so that way you don't have to like copy code in and out or back and forth.
[2871.96 --> 2877.44] Like you might have had to do in other environments or worry about, oh, like I know my remote environment,
[2877.44 --> 2881.48] whether it's a dev container or one of the other options, like have this dependency I need it,
[2881.50 --> 2883.02] but now I need to redownload it locally.
[2883.18 --> 2886.50] It's like, no, you can just develop completely within that remote environment.
[2887.14 --> 2892.94] And what's cool with dev containers too is there's a variety of ways that you can reference what you want to be set up or configured.
[2893.14 --> 2895.76] So like you were saying, you could reference a Docker compose.yml.
[2896.12 --> 2897.68] You could reference just a Docker file.
[2897.86 --> 2899.16] You could reference just an image.
[2899.16 --> 2904.16] It really depends on just like what you want to do, how you have your project set up.
[2904.30 --> 2905.80] Are you pre-building images?
[2906.04 --> 2910.34] So you could even have it where you're like publishing what you made in your image.
[2910.34 --> 2913.84] So that way you can use it then in like dev container json's later.
[2914.06 --> 2916.56] You don't have to redefine all that dev container json stuff.
[2916.68 --> 2918.72] And other people and other projects can use them too.
[2919.26 --> 2922.46] There's a ton of flexibility there just depending on like how your team works.
[2922.46 --> 2923.82] And are you pre-building things?
[2923.92 --> 2925.68] Or are you all using Docker compose.yml?
[2925.68 --> 2929.48] So what happens whenever I spin that image down then?
[2929.62 --> 2931.96] So if my code lives in there, my commits are in there.
[2932.02 --> 2935.76] Does this thing have the keys to, you know, my GitHub essentially?
[2935.90 --> 2937.98] Like how does that go one layer further?
[2938.08 --> 2940.04] Like how am I building inside this container?
[2940.12 --> 2945.24] And how is it ephemeral can go away, but yet I'm not losing my code like I'm five here?
[2945.54 --> 2949.56] So yeah, essentially with containers, you have a couple of options.
[2949.56 --> 2953.72] Or either you can mount your source code into the containers.
[2953.72 --> 2956.28] You can use a bind mount or you can use a volume.
[2956.66 --> 2962.98] And so then we have an option, for instance, in the dev containers extension where you can clone a repo into a volume.
[2963.48 --> 2972.00] And so volumes are the recommended way to work with containers because then essentially it's like a little bit more optimized for how like Docker, for instance, is handling it.
[2972.54 --> 2975.68] And so then you don't have it's like a little bit more efficient as well.
[2975.68 --> 2980.90] So there's kind of a lot of things to get into, like volume, bind mounts, all those things.
[2981.30 --> 2983.64] But yeah, I don't know if that's helpful.
[2984.04 --> 2985.28] Well, I just think of like the resistance.
[2985.46 --> 2989.62] I got to imagine part of the pushback is this confusion, I would say, right?
[2989.66 --> 2993.08] Like, so I'm asking you to clarify it because I think there's a lot of at least it's confusing for me.
[2993.08 --> 2999.74] So, you know, I would imagine like if you if I'm typically I'm Jared, I love my local machine.
[2999.98 --> 3002.78] I don't mind dirtying it up, you know, however it is.
[3003.22 --> 3005.82] Elixir, Node, NPM, install it all.
[3005.94 --> 3006.32] I love it.
[3006.36 --> 3006.62] Oh, yeah.
[3006.62 --> 3006.74] Right.
[3007.04 --> 3007.66] All the things.
[3007.76 --> 3010.40] But then you go to the container and it's like, well, where does my code live?
[3010.48 --> 3010.62] Sure.
[3010.64 --> 3013.16] I understand volumes and I understand binding, you know.
[3013.16 --> 3017.50] And if I'm developing in that container, is the code in that container?
[3017.76 --> 3019.32] Is it still in the local repository?
[3019.90 --> 3023.10] Does it simply just run the mirror image version of it?
[3023.40 --> 3029.34] And I'm still essentially, you know, get committing to my directory right here on my box.
[3029.40 --> 3031.74] And it's not remote, even though it's Docker local.
[3032.10 --> 3034.42] You consider remote based upon what you just said there, right?
[3034.44 --> 3040.42] Like it's still anytime it's not your actual machine and it's in an image, you're saying remote.
[3041.06 --> 3041.62] Yeah, right.
[3041.62 --> 3045.74] And so, yeah, if you have, like you mentioned, if I'm making like commits or something like that,
[3045.82 --> 3050.38] like they're not going to be like, oh, these are just special commits that then got discarded
[3050.38 --> 3052.34] outside of my container or something like that.
[3052.40 --> 3056.66] It's going to be like, no, you can commit back to your GitHub repo and your changes are still
[3056.66 --> 3057.34] going to be there.
[3057.62 --> 3060.76] And so that's kind of the cool thing about having a dev container in a GitHub repo, for
[3060.76 --> 3061.94] instance, is cool.
[3062.02 --> 3062.16] Yeah.
[3062.24 --> 3067.00] Then if I open code spaces or open anywhere else that's supporting dev containers, like I
[3067.00 --> 3070.60] can just work on my code directly there with also the tools that I need.
[3070.60 --> 3072.86] How do the credentials work?
[3073.32 --> 3077.24] So if I open up, I'm logged into github.com.
[3077.36 --> 3078.12] I'm looking at a repo.
[3078.32 --> 3079.46] I open it in the code space.
[3079.62 --> 3085.08] Now I'm logged into Jared Santo fictional journey P775G6, et cetera.
[3085.28 --> 3085.90] Is that the URL?
[3086.50 --> 3087.60] Well, that's part of the URL.
[3087.76 --> 3088.70] It's a fictional journey.
[3089.00 --> 3090.34] It's my current code space.
[3090.34 --> 3095.62] And let's say I'm just, I'm hacking along inside my code space and I say, all right,
[3095.68 --> 3097.24] I'm going to commit this code.
[3097.32 --> 3100.40] I'm going to push it back to my repo.
[3101.14 --> 3102.46] How does it know it's me?
[3102.68 --> 3106.60] How are my security credentials injected into the code space?
[3107.14 --> 3107.48] Do you know?
[3107.48 --> 3107.92] Yeah.
[3108.10 --> 3114.00] So with code spaces, so you can use code spaces in the browser or you could use a code spaces
[3114.00 --> 3115.98] extension in desktop via code.
[3116.20 --> 3119.02] And either way, code spaces is going to handle your GitHub off.
[3119.22 --> 3124.82] So it's up to the code spaces extension or service to securely let you log in and make