‫To the left here I have Sujay.
‫He's a Cloud engineer, a Docker Captain and currently streaming from Malaysia and is a community leader
‫of Docker Penang and the meetup group there.
‫And you can see his little Twitter handle down there at the bottom.
‫You can reach out to him later.
‫Hello CJ.
‫He's going to be talking about buildx, which is a really exciting new toolkit. Take it away. Thanks
‫Bret.
‫So, as we know, we have 19.03. It happened last week. There was a cool feature and this was announced
‫during DockerCon.
‫Docker had extended their support for ARM architecture. Soon after the DockerCon,
‫we got, as a Docker Captain, got access to the Docker
‫Peter version, the 19.03. The first thing I got to was the buildx feature.
‫So, the buildx is actually a Docker label again which extends the Docker Build command
‫and provides you some extra features which are basically provided by the Moby Project which is a new
‫buildup mechanism coming up in Docker. It provides you some cool new features like you can carry out your build
‫on multi nodes, different course. It also provides new build functionality like cache mechanism which
‫is a built-in feature. Basically, I'm going to demo something about it.
‫Let me share my screen for you.
‫Shattering
‫All right can see your screen.
‫Okay.
‫Yeah.
‫Do you see my camera?
‫Yep.
‫Okay.
‫And let me search. Okay.
‫Let's start with the sample phone call program.
‫Let's say is a pretty property property.
‫Basically what I'm trying to do is type basic Hallowell kind of program and go.
‫I have kind of a template for it.
‫And if you see I'm just printing my hostname, my kind of architecture what I'm running on.
‫And the OS.
‫So if I had...I'm basically going through the way which we carry out our development in a Docker environment.
‫So I have my code return and I do the
‫release party so that compiles and I have a binary.
‫So basically when I secured that binary,
‫It prints my hostname and the OS type and architecture what I'm using.
‫Basically I have been going through my development cycle and now it is time to write the
‫Dockerfile.
‫So let's skype for trouble filed for it and if I do, I have a template created for it.
‫Basically I'm using again number 16 build where I'm using go like it made as an image, popping my code
‫into it, building. Then in the second stage, using a scratch that's base image and then
‫that's it.
‫So, in a normal Docker world you would do docker build -d which is tagging my image. That's the
‫best.
‫Basically, I had done already a build of this same code earlier so that everything is scarce and
‫you see the build happening in a fast way.
‫If I execute docker run, sujaypillai/test.
‫That is a code which I had on my machine is Docker right now.
‫I have a Docker image and when I use that Docker image,
‫it's basically printing my container ID
‫which is the hostname.
‫It's running in the next container and AMD64.
‫That was basically the way which we lived our life in the Docker earlier before 19.03 release.
‫Now if in the same, earlier version, if I had to build the same code for a different architecture.
‫Let's say I have to run the code on Pie.
‫I would have to prepare a manifest file for it.
‫Add my Docker images to the manifest list and push that Docker Hub.
‫All I have to do is everything manually.
‫That's where one of the cool features of buildx is it helps you to build Docker images for multi platform.
‫So let's make the architecture.
‫Let me show you
‫that is how it works.
‫Basically when you have 19.03 release installed on your machine.
‫I have Enterprise Edition running on my machine right now and by default, it comes with buildx installed
‫in it.
‫If you are on a community engine, you would have the same buildx CLI plugin available if you had an
‫edge release.
‫If you are still on a stable release of 19.03,
‫the best way to get this that it needs to have projects for buildx, go to the releases page.
‫You can download the binary for it and just what we need to do is just copy it and go to our default
‫Docker directory, config directory.
‫And docker.
‫docker...yep.
‫cli-plugins. As you see I have by default docker-app and docker buildx as cli-plugins.
‫If you had a stable release you would have to manually do that.
‫Let me show you how I can build an image which would be for multi architecture.
‫By the way.
‫I just want to mention you're talking about the...mentioning the plugins. For those of you who
‫haven't heard about the new plugin model in the Docker command line,
‫we'll be talking more about that throughout the week and we'll actually meet Michael Irwin and and others
‫on Thursday.
‫We'll actually be focused on how to build plugins and make your own custom stuff. So.
‫Okay. Yeah.
‫So, buildx has a command called build which is kind of the same functionality which you used to have like
‫docker build.
‫All you need....
‫This is something which I will explain to you why
‫it didn't work.
‫You can see on my machine that I have a docker buildx listing. That is a default builder available which uses
‫the Docker driver. By default,
‫the Docker driver uses an embedded library in Docker which has a storage mechanism called Moby Storage which doesn't support
‫right now multiplatform builds.
‫So what you need to do is that you need to create a new builder which you can do something like this.
‫So what I did is that I the command buildx
‫create. I'm using a new driver type called docker-container and giving my builder a name dckbuilder.
‫If I do docker buildx ls now, I have a new docker builder in my list.
‫The beauty of this thing is that the whole
‫docker build project runs itself as a backend docker container. On my machine if you see right
‫now I don't have any docker containers running.
‫If I start using this one, docker builder.
‫Let's switch to this with a docker buildx use dckbuilder
‫So you see right now it's pointing to this one.
‫And if I exude the same Doctor X amount again it's done in building delicate images.
‫So what's happening right now is is building me just for.
‫Just before Brett
‫Lee M.D. for the next artist 4 and the sound version of it so all it's doing is that it's building those
‫three images.
‫So I notice I'm in Tennessee.
‫That's kind of a battle a little bit is happening on your machine right now.
‫And if you want it you can find all these three bills to be executing on every note.
‫Also all you need to do is that add a new builder which would find to remote not so well if that happens.
‫That is a very good batting push.
‫They may just to get their hub out.
‫So right now Mike I'm on base getting good back in the building they mean it.
‫So what you just did there.
‫I mean make sure I understand you're me ran a single command line that is simultaneously building the
‫same app across different architectures and in parallel.
‫Right.
‫And if you have wanted those machines building could be remote Docker engines not just your local machine
‫right.
‫And then you were mentioning that you could also have that one one liner or do a push at the end of
‫it to a registry assuming it's successful in building that's a lot.
‫Yeah that's a lateral answer.
‫Yes.
‫And in in on top of that then all the pretty images how to build it would create a manifest five for
‫you and push that long along that you need to push on to their doctor yeah cause that that was the tricky
‫part too.
‫I mean a lot of a lot of people don't even realize that manifest files exist or what their use is.
‫You just mentioned that.
‫What does what does or for the double manifest is basically a bill of material for your doctor and me
‫just which is that my doctor and images have captured quite this basic architecture platform.
‫It can run and so basically any you fool I finally meet.
‫Let's see on that and verify it goes and pulls down the specific imaging which can be run on my protector.
‫So all those things up information is stored in the manifest for you actually when the bill gets completed.
‫That's kind of one of the new features for buildings.
‫So the difference.
‫When I said that it runs in a container.
‫Let me show you what happened.
‫So for those eight.
‫Oh sorry.
‫I was going to say just for those that are watching that have maybe seen one of our previous videos
‫or one of one of the previous posts on build kit.
‫This is running build kit in the background for you but the command line is changed so essentially you
‫don't need to set an environment variable anymore.
‫You're using this new yellow Dex command line to do that and then it has a whole bunch of extra features
‫that that you're showing.
‫Yeah yeah.
‫So the whole is like happening in the container using this one.
‫So you basically think it's running in the empty no
‫OK.
‫So the original bills my images and I did in fact the Bush ping saw that to do this once again
‫so you can see a band is exploding manifestly so it's created the medical excuse and is pushing the
‫medical sleuths on the doctor.
‫And if I so wanted quality feature with dark flow and dark stopped at least four and five.
‫Thing is you can look down the early cities within the
‫following and this one so if I do a refresh you should see that image coming up here and if you see
‫it build an image with cars and support for on 64 and 65 pictures.
‫So that was about an index to basically be followed.
‫All this month and let me show you this one.
‫So doc or Ben back in March too.
‫So this is kind of the darker manifest.
‫Come on what we had earlier.
‫It has you to in fact your darker image directly pointing to a remote registry.
‫So right now I'm using
‫the rule is 40 T.
‫OK wow well sorry.
‫So this is kind of the same command which we used to have for the.
‫Manifesto is actually listing down your images which were pushed right now.
‫When I did that.
‫So basically you are having image by release party which is state of the art and it has 3D printed black
‫on support.
‫So these are all the information which goes into manifest both yeah.
‫And for those of you that are really just users of Docker and you're not maybe releasing a whole bunch
‫of multi arch images the way that this all sort of gets exposed to the consumer I guess we'll call him
‫a doctor consumer is if when you type Docker run Python on Mac on a duck or desktop on Mac and you do
‫it or you run Docker run Python on a Raspberry Pi or a mainframe or whatever the architectures are for
‫a particular image for for example there for that Python image it this manifest file and docker figured
‫it all out for you go oh you're running on this architecture let me go find that copy of the image that
‫tagged a copy of the image so that you don't have to specify manually which architecture you're on Docker
‫kind of he knows that.
‫And so what Sue J show in here is the the other side of that coin which is how do I create multi architecture
‫images without having to make a whole bunch of different tags or different repositories for those different
‫images if you've been around Docker long enough years ago that's what we kind of had to do but nowadays
‫all of this automation and and manifest stuff allows it to all be a sort of a seamless single it looks
‫like a single thing single image in Docker Hub or in your registry right
‫and the one thing I love is Dr. Miller has someone called Beck.
‫If I'm not exactly used it right now.
‫But that is a good doctor.
‫Fine.
‫We do have a little bit.
‫If there was an open to us to end up during double fun.
‫And Don you gave a good one hour doc on the biscuit and a portion of it contains an explanation for
‫me.
‫I still like to use this too.
‫I want to be the right person to explain it
‫so yeah.
‫That's all from my break.
‫All right.
‫Pretty cool.
‫The build X stuff is now considered release right.
‫This is.
‫This is official stable or you know it's still experimental.
‫OK.
‫Who qualifies opting so can you show would have been it.
‫Sorry.
‫I think in the beginning it showed how to enable it but can you for those that missed it including myself
‫can you show that again.
‫So if you'd so in other words if you up if you just are getting 1983 Dr. desktop this week because that's
‫it's coming out and you should be getting the updates what do you have to do to be able to use this.
‫So yes let me see.
‫So if you are an enterprise customer you are using Duckworth community as you really is by default ships
‫with it.
‫And if you are on a stable to a laser now what do you need to do is that that is the toughest project
‫for blacks and it has the releases happening monthly I so all you need to do is download the release
‫and copy under the doctor config folder which is under your home directly under this one.
‫All right.
‫Do you talk about that in your blog post on this not it's documented well documented in the IT hub for
‫blacks project
‫I'm going to post your link on buildings.
‫Very cool.
‫Thank you for that.
‫I'm I'm very excited about Bill decks as the sort of the next wave of building because I think it addresses
‫nearly every single thing that I've heard either.
‫I've had an issue with or limitation with or I've seen people complain about or wish that there was
‫a feature in the builder for I see you know there is we could talk all day about Bill decks and all
‫the build kit features and functionality out of it.
‫But this is a really great intro to get you started.
‫So Sue just got a blog post that I just put up that you can check out and you can just search for build
‫x or build kit on the Googles and you can find that all right.
‫So December you dumb down on flash Dr. flash index all right.
‫I posted it twice.
‫Yes.
‫Build x or build X is the command line in front of build kit.
‫So if you want the latest stuff definitely look up builder x.
‫All right.
‫I'm not seeing any build X actually.
‫Wait there might be one specific question in here about build X build Kit says the built so to build
‫X stuff is the same as the environment variable just a newer version of that.
‫Correct.
‫Yes.
‫So when you used to set the build kit environment variable to enable it as the builder with the docker
‫build command.
‫Now you have a different complete command that has a whole bunch of extra functionality so.
‫So the old way of doing it once you're in 1983 and you have the build X plug in then the new way is
‫to use the build X command.
‫So yes it supersedes that old environment variable.
‫If you're want someone who's interested in faster better ways to build images I definitely recommend
‫you figure out a way to get build X and try it.
‫And this is the right time for you to get Docker feedback.
‫How would how would they get darker feedback on these beta features.
‫I think Sue J said there was a build X repo right
‫so just to ask about these men if they've been actually experimental.
‫It's been amended due to the reason that the veto support is not mature enough.
‫But on the Linux side it is fully supported and you can take your production loads to build against
‫build.
‫Is there a repo for this.
‫Yes.
‫If you go Doctor slash you haven't got chest Doctor slash building.
‫All right get up dot com slash Doctor slash build X.
‫So that's the command line plug in that you would then put on your system and then I'm sure it's going
‫to have some information there on how and.
‫Yeah.
‫And then factor looks like it's updated says if you're going to use it you use edge or you can get nightly
‫builds.
‫Yeah.
‫And then because the thing about so the thing about a build right is if if it builds your images and
‫it finishes chances like the builder doesn't affect a production image running as a container.
‫Right.
‫So the builder is really about the thing that's running on your C.I. system or in your logo machine.
‫So if someone was talking to me and they asked me you know would you would you use build X in a real
‫world scenario right now.
‫I would say well obviously start with an on your machine.
‫Don't be thrown in on your production S.I. on day one but.
‫But you know progressed slowly like you would with any new technology but you know build kit has this
‫isn't something that just they came up with last month build kit and build X the build X interface is
‫riding on top of build kit and that's been around years now.
‫Right.
‫Like I think the product itself is like two years old.
‫Yes.
‫So it's not a brand new technology a lot of us have been demoing and showing off build kit functionality
‫for over a year now and in fact you'll probably find some stuff on these YouTube channels talking about
‫build kit from from a year ago.
‫So it's exciting that now finally see it in the command line and see it coming to a 19 0 3 release near
‫you.
‫Are is the plan is the plan for build X for it to be out of experimental.
‫I mean it's not going to be out of experimental anytime in the 19 three released right.
‫So we have to wait for the next stable release for potentially for it to come in a stable.
‫Yeah pretty much.