Conf42 Python 2025 - Online

- premiere 5PM GMT

Docker and Devcontainers on Windows Without Docker Desktop

Video size:

Abstract

Are you part of an organization too large to use docker desktop for free? Do you just not want the Docker Desktop GUI. I’ll show you at least three ways to run windows and linux containers without docker desktop on Windows 10/11 for free, including using real docker.

Summary

Transcript

This transcript was autogenerated. To make changes, submit a PR.
Hi, I'm Justin Deering. Welcome to my talk on setting up Docker on a Windows desktop, without a, without Docker desktop, and without a Docker license. So basically, the problem here, in many situations, if you are a corporation of a certain size, I believe it, certain money or certain number of employees, you cannot, use Docker desktop without paying for a license. Now, my company, my employer, Nudesic, does happen to provide us with Docker licenses, but we are also consultants, and sometimes we get, sent off and have to use a laptop of one of our clients, or a virtual desktop of one of our clients, and they don't have Docker licenses on their machines. so anyway, we're going to go through the setup over here. just some prerequisites, you want to have a Windows machine, you want You need to have WSL set up on this laptop so you can do Linux containers. You need to have Hyper V support. and container support, as well, set up on the lab. So you need those features set up as part of Windows. If you're not a local admin, you need those features set up. Containers, local containers, and you need WSL set up. once, an unprivileged user can install all the WSL distributions they want. so let's start off with the basic situation here. Okay, I'm a Python developer. I'm in Visual Studio Code. I have this blank project over here, right? And I want to start developing Python stuff, but I want to do it inside a container, right? honestly, the easiest way to do that is, make sure you have the DevContainer feature installed. Okay, so install this feature and just go and build a DevContainer. Okay, so we're going to say 3, hold on, let's say zsh, we want it in, let's say we want zsh. Keep defaults. I depend a lot. Okay, and what this is going to do is this is going to create the DevContainer. Now, here's the thing. If you don't have Docker installed the first time, and actually that's how I got Docker installed in this is going to set up your default. WSL distribution, and if it, if you don't have a WSL distribution set up, it's going to sit there and say, hey, do you want to install WSL, WSL distribution, and it will install Ubuntu, and it will install Docker in Ubuntu, and, basically your Visual Studio code will be set up to, to use those for dev containers. And if you ever want to access those dev containers over here, you can just go, here, and we can go into Ubuntu. Okay, okay And boom, there's our there are the containers. I have some wordpress containers running with how I do this, right? so it's going to go inside of here Anyway, like I said when you did this the first time you did this and restarted the container it would just set that up for you. Okay, so that's your first That's your first setup over here. just very simple. Just go in visual studio code Create a dev container any dev container you want. It will set up linux for you now You cannot access this You Without doing any other, without doing a bunch of other socket files and configuration, you're not going to access this docker from outside of W, outside of your WSL distribution. but this is, good enough. if you want to play with containers, just go into Ubuntu and just do it that way, plain and simple. that's the, that's the best way to do this, right? Now what about Windows containers? Now I have it set up, actually, on my machine. As you can see, I have it set up for Windows containers, and my Docker over there is over there. you can install the, what's called Docker Community Edition and it's free, and it's available for free. On the Docker website, they hide it a little bit, but if you just Google or Bing or whatever, use your favorite search engine, look for Docker Community Edition, you can find your way to get a zip file that has just two binaries, docker. exe and dockerd. exe. Now, how do we install this, right? we just unzip the file over here, and I'm going to show you how to do that from the command line. And I'm not even going to, actually, I'm going to show you the website. So you end up on that, you're going to end up, if you search for Docker Community Edition, you'll end up over here. and you'll end up going to this link, you'll go download the last, you'll go all the way to the bottom, you'll download the latest zip file of the day, now it's 27. 5. 1, and then you can run these PowerShell commands. I'm gonna do it old school. I'm gonna do it, I'm gonna do it, from, the command shell, okay? because you can unzip files in the command shell because Windows ships with two Unix utilities, curl and tar, but it's not Linux tar, it's BSD tar, which for whatever reason can unzip a zip file, which is why they went with that. it's BSD tar. Anyway, so xvf, I already downloaded it, so okay. And we're gonna, oh, third time recording this demo. Okay, now, and then you can go add that to the path. So to add it to the path, we already have it set up in the path, as you can see. But you can just go in the registry. You can do this via PowerShell, you can do this via reg. exe, but I'm just going to show you the registry version, and you want to go to, You can either go to HKEY current user slash environment, which is the path just for your user, or if you want to add it to all the users. HKEY current, HKEY local machines, current control set, control session management environment, and it has all these variables, including this one path over here. And there's a million ways, and you'll see SQL and Docker in the path over there. And that's the way to permanently add it to the path, right? and it's in the path, right? So then we're going to go C colon slash docker three slash docker D. Oh, it's actually going to make that folder for me. Okay, so it actually made that in a separate folder. Anyway. and you can say dash register service, that will register the service. And you can see this docker runs the service. Okay, it's running as a service. you can go, in the service list over there, and this is a service you can start or stop just like IIS or any other Windows service. you can also just run Docker D by itself, and where the configuration for this store, the configuration for this is stored in, and we'll actually program data slash docker, and this is, you need to be local admin to get these files over here. And so just, so basically, to install this, you're going to definitely need local admin, To install the docker, but if you want to just, if you just want, if you have WSL in your system already, you can install docker on your WSL system for your Linux containers. And we need UAC activation to activate this. And we're going to show you how to, basically we're going to show you how to configure this from here. So this is a few configuration options which are rather important for Windows containers. Config daemon. json, right? Okay. Now the important thing is here you make a group called dockerusers. Okay, now this group called dockerusers are the users of the, are the users. So basically if you have UACs set up in your machine like I do, so even an admin user, doesn't by default have privileged access, they can't run the docker command. So you have to sit there. And go and make this file and add this to the docker theaters. there's another setting you might want to set in here that you might want to look into if you want to run. 2019 Windows containers on a 2025, on server 2025, or basically like Windows, Windows 11 Insider Edition, basically, to get to that version. you're going to have to set up, Hyper V isolation as opposed to process activation. There's another setting you want to set in here, but there's a better setting. The main setting you're going to want to set in here, you're going to want to set a group called Docker Users, right? And then you're going to want to type, local group docker users add. Over here to add the user, it's going to say at the very end, user. And then you're gonna, so that's gonna make the group. And that can be any group name you want, but I want it to tag with convention. and you can say group name, and then you can say, and then you can say, local group over there. Okay, and that's gonna sit there. And obviously you have to run that at the admin over here, so you're gonna have to, you'll have to go do that command over here, By the way, that weird thing I'm pasting on the keyboard is actually, OBS Studio, how to install OBS Studio, wouldn't get it, the Microsoft Store thing, it's not a password. don't worry, not sharing my password over there. Okay, no such user group, some user, so anyway, you type that command, you set that up, and then, you would register that service, and then you would type, Ultimately, after you register that service, you would type start service to start that up, and then you have Docker running. So that's how you get in Windows, so that's how you get the Docker daemon, so you're, the Docker daemon on Windows, to do Windows containers, the Docker daemon on, Linux via WSL, those is, and those are the two things you're going to want to do. You have some other options here I'm going to show you, and one of them is called Podman, okay? And I have this set up, It's not running now. It's going to tell me the Podman is not running. But basically, to install Podman, and once again, you can go use Winget or something to install this more easily, but you can go install Podman. So Podman is a open source re implementation of Docker. It's a daemon less re implementation of Docker. It is sponsored by IBM. I'm not part of the group that sponsored it. I'm part of a new death hit company that, is owned by IBM, but I don't know the Podman people at all. or anything like that, we tend not to, my, my group tends not to deal with Podman, but I think it's a perfectly fine tool to use, but anyway, Podman is if you live in Red Hat, that's what, is your guided towards, using, Podman is daemonless. Podman does not support Windows containers. Podman only supports Linux containers. Okay, but you can go install, this UI here. And, you can also install Podman on Linux. it seems to work just fine. My main, caution against using Podman is, if you want to use dev containers and you want to use Visual Studio with dev containers, and you're using Podman, you're going to have some trouble. You can go and sit there and, rename the Podman executable to Docker and then, it should mostly work except when it doesn't. But, you're probably better off just installing docker personally if you if your main thing is I want to run dev containers and, do that, right? but anyway, Podman does give you a, desktop edition, like a GUI version as well as CLI version over here. so anyway, we're going to do Podman. Let's see if we can do Podman machine start. and just Podman will run inside of the, there's a concept, Podman has a concept of running these containers rootless, which is, gives you some more security and it generally works just fine. And by the way, for running containers, they work, I run a Minecraft server. on Podman, and it works just fine, and it's as close to production, I've never used, I've never used Podman for a work related thing, but it runs my kid's Minecraft server, so that's pretty close to production. Anyway, you go set that up, and you do, and the Podman command is completely compatible with the Docker command, so I can go to, just to show you, Let's go, pull Azure right down here, or, Podman, and it's going to pull that down, right, so here we go. we've got, that works just fine. So that's another way to do it. The final way I'm going to show you, actually the second final way, is there is Rancher Desktop by SUSE. this is a GUI that, that, that wraps around, some other options over here. Rancher is a, basically, so Rancher is a nice, another alternative to using the Podman Desktop if you want to try this. I've used this before, it works just fine. I'm not going to. Demo it, because you're just gonna install the Gooeys. this gives you, some more options with Kubernetes, and nerd control that, which finally brings us to our final option. So if you want another, open source, container, solution, you can use container D and Nerd Control. ner Container D is a container, Damon and Nerd Control is a docker. Reimplementation of the docker CLI, basically, to do that, right? So you can install these options. there's some support for windows containers. Not the most, the Windows container support is not the most mature here. I don't see much of an advantage of doing this, locally in your dev machine, unless you're already dealing with Neural Control and Container D, and then that part of your whole Kubernetes setup. If that's the case, then totally go for this. Ben, you probably know more about this, than I can show you inside of Lightning Talk. But those are your options over here. you can go here and you can download, This, this has some, certainly some advantages to doing this on Windows Server. Maybe if you want to go with, Container D inert controls as opposed to Docker server. but anyway, that's about it. thanks for coming to my talk. Thanks for watching. And enjoy the rest of the, conference. Check out some of the many other talks.
...

Justin Dearing

Principal Consultant @ Neudesic

Justin Dearing's LinkedIn account



Join the community!

Learn for free, join the best tech learning community for a price of a pumpkin latte.

Annual
Monthly
Newsletter
$ 0 /mo

Event notifications, weekly newsletter

Delayed access to all content

Immediate access to Keynotes & Panels

Community
$ 8.34 /mo

Immediate access to all content

Courses, quizes & certificates

Community chats

Join the community (7 day free trial)