Local Environment with Valet, Homestead, and Docker, with Chris Brown, Jose Soto, Joe Ferguson
Matt Stauffer:
Welcome back to Laravel Podcast season four. Today we're going to be talking about your local development environment with Chris Brown, Joe Ferguson and Jose Soto. Stay tuned. All right, welcome back to the Laravel Podcast season four. Each topic is about a single episode that we try to really focus on trying to bring this conversation both in a way that brings something new to people who have been using Laravel for ages, but also trying to make it really approachable and understandable for people who are brand new to the Laravel community.
Matt Stauffer:
Today we're going to be talking about local development environments. We're talking about Valet, we're talking about Homestead, we're talking about Docker. And for those of you who aren't familiar, Valet and Homestead are official Laravel projects, and so they are going to be talking about how Laravel actually specifically recommends that you work with them, and then Docker is a tool that there is some unofficial Laravel projects, but also some just very unofficial tooling and ideas and ways you can work with that. So we're going to be talking about three different things. Because of that, we're going to have three different guests.
Matt Stauffer:
My guests this week are Chris Brown, Joe Ferguson and Jose Soto. Just in case anybody worries that I like one of them more or less than the others, or I like the technologies more or less than the others, I chose to alphabetize by last name so that we didn't have any concerns about that. For this particular one, we are just going to be going... Every single question, I'm going to start with Chris talking about Valet, Joe talking about Homestead and Jose talking about Docker so that you can always know with each question that's the order it's going to go. Can each of you, in that same order, introduce yourselves really quickly to the people?
Chris Brown:
Sure. I'm Chris Brown. I've been doing opensource development on an e-commerce platform called Zen Cart. Lots of procedural code, but it's a real, established platform for about 15 years, and recently I've been doing maintenance on the Valet project. You'll see me on GitHub as DrByte, and that's pretty much what you need to know about me.
Joe Ferguson:
Hi, I'm Joe Ferguson. I have been a professional developer for about 15 years. I, more recently the past several years, have had a big focus on system administration, specifically around CentOS and Linux and Ubuntu, some of the other various flavors. Focused on devops and security and infrastructure.
Matt Stauffer:
All right.
Jose Soto:
Hi, I'm Jose Soto. I'm a lead programmer at Tighten, and you may have seen me online at Twitter @JoseCanHelp. I'm an outspoken user of Docker, so I'm here to talk a little bit about my Docker usage and how I think other developers can benefit from it.
Matt Stauffer:
Yep. And you might have seen Joe on various PHP community-related stuff, but also as I think the primary maintainer of Homestead right now, and Jose has done a podcast with the Tighten Podcast Twenty Percent Time, and then also a video with Laracast about Docker as well. So you've probably seen them in those places, as well. Thank you, all three of you, for joining me. It is a total pleasure to have you all on the call. I am currently recording from my home office. It's a different home office than it was. I'm trying to get all my echoes right, but the biggest bummer is I don't have a second monitor, so I can't see you all, and I just realized how much having video of the people I'm talking to matters to me. So I'm feeling a little disconcerted right now, but I think we're going to make this work.
Matt Stauffer:
Okay, so the beginning of every, single episode this season, remember, the main thing that we want to start with is if you had to describe this topic to a five-year-old, how would you describe it? Obviously there's going to be some very similar pieces here between all three of you, so maybe this one might be a little bit less appropriate for a five-year-old, maybe we were going to move up to 10-year-olds or really early level developers, but let's just start. What's the simplest possible way you can describe Valet, Chris, Laravel Valet, to someone who knows nothing about it? A five-year-old if you can. If not, just someone who really knows nothing about Valet.
Chris Brown:
Sure. When developing or testing a website, you've got to be able, obviously, to use it, preferably without affecting the live production real, live website. So it's very common to want to have the ability to stage, run that actual website right directly on your own PC. So on your Mac, Valet lets you do that directly by running NGINX and PHP right there on your own computer. It also helps set up SSL certificates and do DNS resolution, and even allows sharing to outside resources from your remote testing, and all of that without the overhead of Docker or virtual machines.
Matt Stauffer:
All right. There fire is here. We're ready to go. All right, Joe, if you had to explain Homestead, and again, these ones are a little bit... We're talking about NGINX and SSL certs, so obviously it's not all five-year-olds, but the simplest possible way that you can explain Homestead in the kind of similar way that Chris just did Valet.
Joe Ferguson:
Yeah. So the basic introduction to Homestead and what it is, is it's a way to run a server on your machine with the key differences being that it is emulating or virtualizing every piece of a server. So you're using a virtual CPU. Your CPU on your host machine is virtualizing a virtual CPU, virtual hard drive, video card, drivers, all that fun stuff, for an entire virtual operating system. So it's like running another computer in your computer that is completely self-contained and isolated into its own environment. You can custom configure and provision and spin up and destroy these machines at will, and you can restore them to a known working, good state relatively quickly. It's just a good, self-contained, don't have to install too many tools on your host to be able to use.
Matt Stauffer:
All right. Thank you, Joe. And Jose, what about Docker? And I know that Docker's probably the hardest one, so if you could give us just a little bit of an idea of what Docker is and then kind of what Docker in development looks like. I know there's a couple different contexts there.
Jose Soto:
Absolutely. Yeah, I had a real struggle trying to think of how to make this palatable for a five-year-old, but I'll do my best. Docker in a way is, it's a way to virtualize small services, and in doing so, being able to host an entire application. So wrapping application into smaller containers, being able to run them all on a similar machine and it being more efficient than using something like Homestead, which virtualizes your entire operating system. Docker can take smaller services and use the same resources to run those and virtualize those in a containerized environment.
Matt Stauffer:
Yeah. Yeah, that's good, and a few more gauntlets thrown here and there. So now that they have given you the basics, I'm going to give the simple version, and this simple version wouldn't have been enough, so I appreciate you guys giving a little bit more in-depth versions. In my perspective, Valet is... Let's say to run a development environment, whether it's production or local or anything like that, you need things like NGINX and you need things like PHP and you need things like MySQL. Valet installs those things on your Mac really easily. Homestead spins up, uses Vagrant and VirtualBox and stuff like that, to spin up a fake little computer, virtualized is the word we're using, but it's basically like a whole pretend computer running the process on your computer, and installs all those things on that.
Matt Stauffer:
Docker allows you to spin up a whole bunch of little fake, mini pieces of a computer, each of which have individual pieces. So Homestead and Docker are very similar in that the things that are serving your website are within little containers. They're in within little, virtualized pieces of computer that are running on your computer, but Homestead is all in one, and Docker can be all in one, I think that might be what Vessel's like, but Jose, you can tell more about it, but often Docker's a little bit at a time. Homestead's all in one, and then Valet is all in one, but that one is your computer. There's pros and cons with all that one being your computer.
Matt Stauffer:
So kind of three different approaches that share certain pieces for sure. We've already gotten a tiny bit into the selling points, but Chris, could you tell me for Valet, what is the biggest selling point of Valet and what technologies is it based on?
Chris Brown:
Sure. It's obviously based on NGINX and PHP, as I had kind of mentioned, running directly on your computer. But I think the key thing that differentiates it is it's very close to the metal. It's running directly on your own computer, so NGINX is running right there, PHP right there. It depends on Composer to install Valet, it uses Homebrew to manage package installation of all these services. It has Dnsmasq in order to do all the name resolution, and all that's running right there. SSL certificate generation is done internally and managed into the key chain of your OS. Those are the primary reasons why one would want it. There are, of course, limitations to it, and we will talk about some of those a little bit later I'm sure, but primarily when you want the speed of something right there and then, and you just want to get running, it's a great option to start with.
Matt Stauffer:
Yeah. So you have the speed both with the bare to the metal, but you're also saying the speed of how quick that you can get it set up, right? Yeah, and Valet bundles a lot of that for you. All right, so Joe, can you tell us a little bit about the selling point not just of Vagrant and VirtualBox or whatever else, and VMware, but what is the biggest selling point of Homestead and what technologies is it based on? I know I said a couple there, but can you go in a little bit more depth?
Joe Ferguson:
Sure. Homestead is based around the fact that you, the developer, may not know how to install Linux, and you shouldn't have to install Linux, let alone PHP or any of these other server tools or software. It's for the user that doesn't care about understanding some of that. It's written in Ruby, so it's a cross-platform, runs on MacOS Linux and Windows mostly the same way. Vagrant itself is an API consumer, is the easiest way to think about it, and it consumes the APIs of a provider, which would be VMware, VirtualBox, Parallels or Hyper-V, on whichever platform you prefer, and the big thing for me that makes the most sense about Homestead is it's prepackaged, ready to go out of the box in around 60 seconds on a recent Mac, and at run time. So that's a pretty strong statement for spinning up a dev environment. If you prefer to spin up your dev environment through Composer, I can install Homestead in just about any modern PHP application in three steps as long as you're using Composer.
Joe Ferguson:
It's really self-contained and kind of the everything in a box, but that does come with a trade-offs. There's a size factor, there's some processing time factor, there's RAM usage, but it's all about trade-offs. Homestead is the exact one-to-one replica, if you're using Ubuntu 1804 in production. If you're not using production, it's close. It is closer, in my opinion, than running Valet because Valet's on your Mac, but it's kind of a trade-off. If you're on a lower-end machine, Valet is amazing. If you're on a really beefy machine, you may not notice the trade-offs between Docker and Vagrant. If you're on a Mac, you'll probably definitely notice the trade-offs between Vagrant and Docker just because of memory management and how these technologies exist on the Mac platform.
Matt Stauffer:
All right, thank you. And Jose, for you, what's the biggest selling point of using Docker in development and what are the major options? I know it's not just that there's technologies it's based on, but there's different ways you can use it and different kind of pre-made groups of Docker tools for the Laravel world. So what is the biggest selling point and what are the major options when you're thinking about using Docker for local Laravel development?
Jose Soto:
I think one of the bigger selling points for using Docker is, similar to Homestead, you're going to be able to run the same application in any environment. It's going to make it exactly the same, no matter where you run it. The biggest difference in my opinion is that you can pick smaller pieces of what you want to virtualize using the Docker environment versus Homestead. Homestead does tend to be a little beefier like Joe was saying, it tends to be a little heavier on your systems, and with Docker kind of using the same resources for multiple containers, it's less of a factor, especially if you're running multiple containers, whereas if you're running multiple Homestead environments it will take up a lot more space on your system.
Jose Soto:
As far as the options go for using Docker for Laravel development, you can go the route that it's kind of meant to be used and encapsulate an entire application and be able to deploy that using your Docker files or Docker Compose files. However, you can also use it if you're... Similar to how Valet is not really meant for deployment to production, you can use the same mentality in using Docker for your local development environment and just have it facilitate some of those services that your application requires. Docker is very flexible in its usage, where you can use it in a very production-ready, focused environment or just get something working on my machine and have it containerized so that none of the other services are conflicting with it.
Matt Stauffer:
That totally makes sense. And when we're talking about using Docker, if you're using Docker, you mentioned the way it was meant to be used, meaning you have a single container that's containing all of that, there's Laradock and Vessel, are there any other common ones that are prepackaged like that?
Jose Soto:
There's lots of tools out there. I think Laradock and Vessel are some of the more used ones, but yeah, those...
Matt Stauffer:
And those two both kind of had that same assumption, right? Where you have a single Docker container with all your dependencies so you're kind of using Docker a little bit like Homestead or not?
Jose Soto:
Yeah, so Vessel... Okay, let's start with Laradock, because Laradock is the bigger beast. There's tons of services that it allows. It really wraps up your entire application in containers and allows those containers to communicate with each other. You have full-on virtual networks communicating with each other. The production-ready focus, you could use Laradock for that. Not to say Vessel isn't, we'll get to that, but Laradock has a lot more options. Vessel is more of an opinionated version of that, where there are less services available and you just kind of have a smaller subset of services that you would require to run your application. I would liken Laradock to the bigger beast and Vessel is kind of the MAMP of Docker environments.
Matt Stauffer:
Got it.
Jose Soto:
So that's how I would differentiate the two. They're both great services and I've played around with both of them.
Matt Stauffer:
And I know that, sorry, I'm asking more questions for Jose than everybody else, but I think he covers the broadest range of options here. There's one other way of thinking about it, which you have talked a little bit in a few of your common ones, where what you often do, and I'm going to tell the simple version. You've talked about how you, instead, spin up individual containers for individual services. Could you tell us a little bit about your way of working with Docker for local development?
Jose Soto:
Sure. I think the simplest way to think of how I use it is instead of using Brew to install services locally on my system, I use Docker to containerize it as a daemon running on my system. In that way, I can work just like I'd be working as though it's a local server, let's just say MySQL server. I set up my environment files in Laravel exactly the same way, using local hosts, the same port 3306. It's as if it's running locally, but it's actually containerized in a Docker container. What that allows me to do is just kind of pick and choose the specific service that I want, and I can even share those across different applications, which I do, but it's really a facilitator. I use that term quite a bit because that's all it really is. It's what I use to communicate with those services instead of my local system.
Jose Soto:
My flow really, it's working with Valet to host all of my sites across all of my repositories, but then if one of those requires a MySQL server, I just turn on my Docker container, my MySQL Docker container, or if it requires Postgres I can boot up my Postgres container. Same with Redis. Anything else, my Elasticsearch, my LeSearch, whatever it is I need. I just kind of have these one-off containers that I boot up and use, sorry I'm lagging here, and I use virtual hard drives, essentially, that I connect with those so that I persist my data. I can bring those containers up and down, but I have a persistent set of data I that use across those containers. So I can even destroy those containers and not have to worry about losing anything, bring those containers back up at the point that I need them.
Matt Stauffer:
That's helpful and so I think that's, the helpful idea here for me is that we've got Valet, which is installing all the dependencies on your local machine, we've got Homestead, which is installing all the dependencies in a virtualized machine, and in Docker there's at least two very distinct ways to do it. One of them is to install all your dependencies in a single Docker container using something like Laradock or Vessel, which is very much like Homestead. And then you've also got Jose's way of working, who I don't think I've seen many other people talk about, which is much more like Valet, but instead of using Homebrew to install the dependencies, you're using individual Docker containers to install dependencies.
Matt Stauffer:
So we kind of have four ways of working, and of the two Dockers, one of them's a little bit more like Valet and one is a little bit more like Homestead. Does that sound right, everybody?
Jose Soto:
Right. With one quick caveat I just want to say.
Matt Stauffer:
Yeah, please.
Jose Soto:
It's not one, big container, like let's say, Laradock Vessel. It's not one, big container, it's a lot of multiple containers that you manage using your Docker Compose files.
Matt Stauffer:
Gotcha.
Jose Soto:
So it kind of wraps them up as thought it were one application, but there are multiple containers that-
Matt Stauffer:
They're still individual containers. Yeah.
Jose Soto:
... it boots up.
Matt Stauffer:
No, thank you for that. And I kind of meant to clarify that, because I think that's getting into the point where I lose my level of knowledge at Docker, but I appreciate you clarifying that.
Jose Soto:
Of course.
Matt Stauffer:
As someone who actually understands it. Okay, so we're talking about working with your own sites locally, and all three of you are programmers who work with sites locally. Obviously I brought you on because I think you have a connection to the particular tool you're in, but I would just say, for each of you, what is the tooling that you use for your local dev? Both in terms of the things we're talking about now, but are there any other aspects that you work with? And so I think for each of you, I would just say first of all, what do you work with? And then let's say there has been any moment in the last few years where you use something other than your default, what was it and why? So Chris, what is your primary default when you're working in Laravel applications, and when have you recently reached for something other than Valet and why?
Chris Brown:
Sure. Well, obviously I'm using Valet all the time. I find primarily I use it because most of the work I'm working on is something that is direct, immediate, I'm running the code, testing something, developing something. I'm not needing to mirror production environments very closely at all. Say, for maybe a major gap in PHP versions where there's serious breaking compatibility between things. But otherwise, most of the things I can test using a current, modern PHP version and not need to downgrade to things.
Chris Brown:
When I need to match production, though, that's when I will reach for Homestead because I know I can easily downgrade to a much older PHP version. I can let the related dependencies all be in place automatically as well. That's kind of where I draw that line of distinction between the two, and I think that's probably the biggest reason why someone would want to skip Valet temporarily if they're regularly using it to reach for something different, because it's not meeting a need. Because it's not really designed to work with very old PHP versions. With the ongoing drop of PHP version support by Homebrew, I think they only support it back as 7.2 now, so PHP 7.2 is the latest that they're still supporting, and in the fall when PHP 8 comes out, who knows what they're going to do there, too.
Chris Brown:
So when I need to go to something older than that, then I'm very tempted to not try and make Valet work with the older ones. It can go back to 5.6, but it's complex. I'm much more likely to reach for Homestead for that.
Matt Stauffer:
That's helpful. And Joe, before I ask you, Jose, do I remember correctly that you did something with trying to host an older version of PHP in Homebrew or something? Did that ever go anywhere?
Jose Soto:
I mean, I created it and it was used a little bit. I haven't really taken a look at that lately.
Matt Stauffer:
Got it.
Jose Soto:
But yeah, I did create something where people can just install older versions of PHP that were no longer supported, and that was because we needed to do something similar, install a local version of an old PHP version. Yeah.
Matt Stauffer:
Yeah. Okay, thanks. All right, so Joe, what is your default tooling that you work with, probably Homestead but we'll check, and when is the last time that you reached for something else and why?
Joe Ferguson:
My default is really it depends. I touch Docker and Homestead every day. A lot of people think that I'm just 100% in Vagrant, sorry, I touch Docker every single day for my day job as well as PHP development. I think for me, it comes down to what do I need? Do I just need a web server and a PHP binary? Then Valet will get me, heck, even the internal server may get me what I need for that particular exercise or whatever I'm working on. If I need some orchestration or if I need a couple of different services wired up, I'll instinctively just do that in Homestead because Homestead is already that 99% installed and configured opinionated Linux environment for me, so I already know where to put things in order to have them kind of just magically work out of the box there without having to stand up extra services on my machine like I would have to do in Valet or in Docker like I would have to if I was trying to do some kind of mix mash choice or option.
Joe Ferguson:
But yeah, it just really depends. If I'm doing something that's just super involved, Valet will get me a lot of the way because I instinctively run a lot of services on my Mac natively just because sometimes I want that speed. There's a lot of projects, especially legacy projects, that have a really large number of files, and that will trigger sometimes, in some cases, depending on your setup, the Vagrant issue that it has specifically with VirtualBox around sharing files and virtualizing those files from your Mac into the VM. A lot of people, and that's why a large portion of the PHP community has this really nasty taste of Vagrant in their mouth, because they had these horrible issues trying to figure out how to make these Vagrant machines work faster, and they were just trying to virtualize too many files. And ultimately, that's just one of the trade-offs, is if you want that instant access to millions of files in your repository, Valet is going to give you a much better file IO than anything else.
Matt Stauffer:
Obviously you're definitely using more than one at the same time here, and Jose, I'm kind of expecting to get the same answer from you, but I'm curious, what is the tooling for your default for local development, and when's the last time you worked with something else and why?
Jose Soto:
Sure. Matt, you may not know this, but at Tighten we work with lots of different clients. We have lots of different environments. Clients will come to us with fully hashed out Docker files that we'll work with. Sometimes they'll come to us with just a plain site that we can through Valet. It really just changes depending on what the client has, but 90% of my local development environment work is using Valet and Docker for maybe one or two extra services. For the most part, I don't start up new projects with a fully hashed-out Docker Compose file. My go-to is just Valet and maybe a MySQL container or something along those lines.
Matt Stauffer:
Yeah. Yeah. For me, the majority of coding that I do these days where I'm actually doing the whole thing from A to Z is side projects and fun stuff, so Valet's the perfect fit for it. I just spun up a Laravel app, I'm trying to spin something out in a couple months, and it's on a modern version of PHP and its complexity is not in its dependencies, its complexity is in getting something done interestingly as quickly as I can before I run out of time. So Valet is the dream. That's why I built Lambo as well, I just need to be able to get ideas out on virtual paper quickly. I have not spun up Homestead in a long time, but we used Homestead for quite a few projects, especially legacy projects, and I still think the world of it when it's the right thing for it.
Matt Stauffer:
For the longest time, I fought Jose on Docker, but one day I was doing my, "Everything's installed by Homebrew," life, and something totally borked on MySQL install, and I was just like, "oh my gosh, I'm trying to restart this all from scratch," and blah, blah, blah, and Jose's like, "why don't you just try this idea I have?" And so he got me to download Docker and run like three calls on the command line, and all of a sudden I had a fully-functioning MySQL client. And then very soon after that, I needed Microsoft SQL, which you can't do with Homebrew. I don't even think had to go to Jose, I just said, "Oh, maybe I'll look it up," and again, three lines. Because I've installed Microsoft SQL on a Mac before and it was miserable. And this? Three lines, five minutes. I was just blown away.
Matt Stauffer:
So I will say that I think Homestead 100% has a lot of value. I use Valet every day. I have never worked with the Laradock and Vessel-style Docker, but the Jose-style Docker is quickly becoming one of my favorite additions to my Valet use case. So I've got a little bit of all of y'all's stacks in my day-to-day work. All right, so what is the most common challenge newcomers run into when they're trying to get familiar with or do more advanced work with your system of choice? We'll start with Chris again with Valet.
Chris Brown:
Yeah. I think one of the things I meant to mention earlier is that Valet doesn't require any special configuration per se to get it running. You just tell it how to, in fact, it already knows to look at certain directories on your computer to serve from those. There's no custom configuration needed other than maybe just set up your .env file with the details for a certain project. As long as you've got all that set up, it really just runs out of the box.
Chris Brown:
But as far as common challenges, the things that would be the gotchas in that regard are maybe having old applications set up in your global Composer json file, or you haven't updated global Composer in awhile. I think it's a good idea to regularly run Composer global update and make sure you have the most recent things in there, and even uninstall global things from your Composer, global json, remove stuff you're not using anymore or update version numbers and things like that. Otherwise, you run into conflicts that just don't make sense and you probably aren't even aware of those issues going on.
Chris Brown:
Similar with Homebrew. Sometimes people don't run the Brew upgrade command. It will allow you to not only update all the lists of the recipes that Homebrew uses, but then of course also actually install the updated versions of different pieces. So that's how you can get a newer version of PHP and upgrade your NGINX to more modern version of the software itself. Same with Dnsmasq and other pieces. I think probably the biggest challenge people have is when they want to switch to older PHP versions, particularly what's not supported by Homebrew anymore. And so that's where, as Jose had talked about and Matt talked about, these custom taps that can be used to reference or leverage an older version, they work, but sometimes you have to do some handholding.
Chris Brown:
Another gotcha that you can run into is if you've got a much older MacOS version, then sometimes the dependencies that are there by default in PHP, the reinstalled PHP version, can create conflicts because it's not compatible with the PHP code that we're using to actually write Valet and run Composer itself. So those are the primary challenges. I think one of the other issues that people typically need to be able to navigate their way through is they just have the unknowns of the internals of how this all works. Probably this is the same with Homestead and Docker, too. When our day-to-day work doesn't give us awareness and understanding of not just devops, that's an important piece of it, but all the rest of the internals of how these tools kind of actually sit in and integrate with your system. That's when you run into difficulties trying to troubleshoot it. Something's just not working, how do you get there? How do you make that go?
Chris Brown:
I think Valet has its pros and cons in that, because it depends very much on the metal, and so if you have other things going on in your OS, those can create conflicts, whereas Docker and Homestead abstract that away. They separate that out of the picture, so as long as you can have those platforms running, you're not running into those difficulties. Although you have issues within the containers or in the VM, then that's another story, but I think that's where you run into mostly common issue related to Valet. That's a big long list, but really it's not all that complicated.
Joe Ferguson:
I really feel what you said, that that was going to be, the not knowing how it works is going to be really similar to Docker and Homestead, and I can't tell you how many times I correct people on how to use Vagrant or how to interact with VMs, and it really is one of those common challenges with Homestead, is just getting your head wrapped around what is a virtual machine and what is it actually doing? Let alone, how does VirtualBox work or how does VMware work? How does Hyper-V work? And then, there's nuances to each provider that Homestead is able to use that you kind of have to know about. If you're brand new to these technologies, you may not. You may not be aware of them, you may not know some of the things.
Joe Ferguson:
I just had to, unfortunately, break some bad news to a Homestead user the other day, where they opened an issue on GitHub, and they had the problem where their SSL certificates had expired. The problem is, Homestead's designed to be kind of short-lived. Spin it up, destroy it, and then come back to it when you need it. We do all of this configuration at run time, called provisioning, which actually sets up Homestead for you. When you download Homestead and just install Homestead, it's Homestead for me. It's my opinionated Ubuntu Lavarel box. When you actually run Vagrant up and it applies your configuration, it is now your Homestead. So that's how it spins up all your sites, but some of the gotchas are not every provider works the same, so on some platforms there's some differences, like on Windows, networking is a bit of a pain if you're using Hyper-V. On pretty much all the platforms, VirtualBox has issues with file sharing, where it can be really bad performance or it can be really good performance and you'll have some other weird issues.
Joe Ferguson:
The thing that kind of made me chuckle while you were talking about what were some of the gotchas with Valet and having to deal with some of the issues with Homebrew, is I thought to myself, "Well, at least when Homebrew goes bad, you don't get a Ruby stack trace like when Vagrant goes bad." You want to anger a bunch of PHP developers, shove a Ruby stack trace in their face and ask them to debug it.
Jose Soto:
So true. Yeah.
Joe Ferguson:
Vagrant is written in Ruby, so everything, whenever you throw an error, that's what you see, is you see a Ruby stack trace. If you didn't realize Vagrant was written in Ruby, so is Homestead. Homestead has been written in Ruby since day one. There is a Ruby class that translates your YAML to the actual configuration that gets applied to the box. So yeah, knowing Vagrant or not knowing how to interact with these boxes, not knowing how these VMs should be treated, they should be treated like cattle, not pets. That's an engineering/devops type of way of thinking.
Matt Stauffer:
I like that.
Joe Ferguson:
Let them be short-lived and kind of blow up. And that user that came to me and said, "Well, I have this box." I did Vagrant up in March 2019, and honestly I'm surprised this VM was still running, because that is definitely one of the longest VMs I've heard about running, but it happens, where people make these configuration changes or they get something working and they never turn it off, and that's a really big problem because Vagrant is designed to be configured and spun up, and if you make any changes to the environment, you're supposed to apply those in different places. Homestead gives you the features to be able to do that, so if you need to have a file in one specific location, Homestead has functionality to allow you to make that happen. And if you don't, then if you run Vagrant destroy, which will destroy the environment and then spin up a new environment, your files and everything will still be there because you're sharing them through the mapped folders, which is going to be similar to what Docker does with volumes. But the problem is, any configuration or change you've done since isn't going to be applied, so then you're going to have to go figure out what you've done and apply all those back.
Joe Ferguson:
Vagrant is a lot, and Homestead is a lot to wrap your head around, but you don't have to know Homestead like I do. You don't have to get to that level of Homestead, especially if you don't want to. If you don't care about Linux servers, go find what you're passionate about and get better at that, is my advice. Let me worry about Homestead because I love this stuff.
Matt Stauffer:
That's great. Thanks for answering that. What about you, Jose?
Jose Soto:
Similar to what Joe and Chris both said, the understanding of how it all works, it's super important, and I think that's one of the more challenging things for newcomers with Docker. In my experience, I come from a systems administration background, and I talked about this in Twenty Percent Time podcast, but having gone from just straight working on servers to using something like Homestead, I had a better understanding of kind of how to manage it. I could SSH into my machine, I could make some changes, I could bring the machine down, bring it back up, and I knew more or less what was happening. But then jumping into Docker, trying to transfer that knowledge over to Docker just didn't work, because the system is set up so differently.
Matt Stauffer:
Interesting.
Jose Soto:
The ephemeral idea of bring up a Docker container and bringing it down and the file system changing, and understanding what parts of the file system change and what parts don't, it's a big help to know that, but it's also a big hurdle that newcomers need to get over in order to use something like Docker efficiently on their local systems. Of course it all comes along with Docker commands, and there's, "What is Docker Compose and how do I use Docker Compose?" When you start reading through the documentation, there's so much data being thrown at you that if you don't really have someone to kind of lead you a little bit, it can get very overwhelming very quickly. That led me to, over the course of a couple of years, I just kept going back to Homestead because Docker just was so confusing for me.
Matt Stauffer:
Yeah.
Jose Soto:
It was a lot of work for me to finally grasp and understand how to use Docker versus how to use something like Homestead. But yeah, I think like Chris and Joe both said, understanding what's happening and how it interacts with your machine is one of the bigger issues for newcomers.
Matt Stauffer:
One of the hurdles, yeah. That's great, guys. And I think there's one note I wanted to say there sparked a lot by what Joe was saying. So the idea of cattle not pets, I want to dig into that a little bit because it's something that I've talked a lot in a few different of my talks of using kind of bigger language, and I wish I had used simpler language. When I talked about some queue workers and stuff like that, I was using all these different words like item potent and asynchronous, all this kind of stuff that I think that people lost a little bit of my message. So want I want to say is, the more we build things that are not precious, the better off we are. I think that precious thing kind of deserves an entire podcast of its own.
Matt Stauffer:
When I was giving my Laracon talk a couple years ago, I was talking about basically making sure that your queue jobs are not precious, meaning they don't expect that there are other queue jobs running, they don't expect that a particular job ran before or after them, and all this kind of stuff. So I think that when I think about what Joe was saying in terms of cattle not pets, we're talking about don't make them precious, and what that means is don't have them so perfectly configured that if you have to destroy it and spin it back up it's a problem.
Matt Stauffer:
One of the things we've run into a ton with when we as Tighten come onto a project with existing developers, one of the first things we often have to do with them is to move them from precious servers to nonprecious servers, from pet servers to cattle servers, meaning yeah, we know that you've been using the same server for the last 10 years and everything's hinged on that, but everything is so fragile. And when we're able to get people to the point... Now, we're not often getting people to a point where they have an AWS auto managed, auto scaling thing where servers are spun up and down. That's the dream, but I think that that's often a lot of work to get to.
Matt Stauffer:
But the space in between my 10-year-old precious server and that is to have your setup in such a way where there's documented, minimal steps, preferably programmatic, that get you from nothing to a functional version of your production environment or your staging environment, and I think that there's a parallel here, and that's a little bit what we're talking about with these, is like how do I get from nothing to a functional local environment more quickly? And what does it look like when I have to destroy something and rebuild it?
Matt Stauffer:
In the Valet world, I think the most common time I see that is people who are custom parking a whole bunch of individual folders, and just, if anybody who doesn't know, with Valet, the two ways to do routing are one, you can tell a... Well, first of all, every Valet install needs to have a particular TLD. The default right now is .test. So if you spin up a normal one, you're going to park a particular folder... Sorry, I think I'm getting my words wrong. Park a link.
Chris Brown:
You're right.
Matt Stauffer:
But basically... Yeah. So if you were to spin up, install Valet right now and point it at let's say your sites folder, because that's where mine are, every single subdirectory under that would be served at the subdirectory name .test. So that is a nonprecious way of setting up Valet. A more precious way is to individually link every single folder across your whole computer in all sorts of different places such that if for some reason your Valet configuration was broken, it's going to take you a long time to get back to it. Go for the nonprecious.
Matt Stauffer:
Another one is relying on the state of your MySQL database, whether it's in any of these particular tools, and relying on the data of those being a particular state, and what happens if you lose all that data? If losing all the data in your local development environment is a problem, that's precious. If you can recede all that data really quickly, that's not precious, and so I really appreciate the general idea that we want to get to things where getting a new computer or losing your MySQL database or having to restart your Homestead box, whatever else. Or like Jose said, he talked about having to shut down his Docker instances just when he doesn't need them to save memory. Granted, he does have a storage volume that's persisting between, but let's try to shoot for... I would just say for everybody, shoot for things being less precious, because not only are there tons of problems that can be solved by your ability to unfreak-outingly just spin up a new version of whatever it is you're working with, but also it's going to help you prepare a lot better for scale issues. So obviously that's less of the case locally, but I just really wanted to point out that obviously it's not specifically about this episode, but I really appreciate you all kind of bringing that up.
Matt Stauffer:
All right. Matt rant over, back to you three. Now that we've talked about common challenges that people run into, it did seem a little bit like some of your answers had to do with things that people need to know, but I do want to specifically call out that question. What is one thing, and if you've already said it you can just answer it really briefly, one thing that you wish all the normal users of your system of choice, so Valet, Homestead and Docker, what's one thing you wish they all knew? And my guess is these answers are going to come a lot from, "I see people have a lot of pain because they don't know this thing," or, "I see a lot of people not using it because they don't know this thing." So what's one thing you really wish they knew about your system of choice? Chris?
Chris Brown:
I have a list of five things.
Matt Stauffer:
All right.
Chris Brown:
But it's not really to directly answer the why behind you're question, they're kind of things that have come up as we've been talking. I love your point about holding things not too preciously. One of the things I do with Valet is I have my Valet environment, but my production environment may be slightly different, but my CICD system is the one that's very close to that production setup. So I will catch issues day-to-day with general stuff, but then when I go to actually my continuous integration process, I've got something there that's really very close to the production server setup, and then I can catch all the lost things in that process. So I have that safety net in that way. I think that's a helpful way to have the hybrid. One of those actually has been Homestead as my CICD kind of staging, testing or sanity test before I go to production if I'm doing a very manual deployment to production. I'll often do that.
Chris Brown:
As far as things I wish people knew, I really wanted to use this segment to talk about some tips and tricks. Very often, the questions people have about customizing Valet, it's just they're not aware of some of the ways things can be done. The Dnsmasq is one of those things. If you wanted to change which DNS server your computer normally is resolving from, I like nowadays to use Cloudflare. I used to use Google's 8.8.8 address, but now I use Cloudflare, 1.1.1.1, and I can actually just drop in a custom config file in my home.config/valet/dnsmasq.d directory, and in there I can put any number of .conf config files, and those can contain all the directives for custom config-ing of Dnsmasq.
Chris Brown:
So I use that to put in whitelisted IP ranges and blacklisted IP ranges, and also so that helps me deal with spam stuff and undesired sites to visit and things like that, specifically to get around ad tracking and stuff, too. But I use it to switch which DNS server I want to use from time to time.
Chris Brown:
Similarly, PHP configurations, the php.ini configs, it's in the homeroot configuration area of PHP, so that's /var/local/etsy/php, and then your individual PHP version has its own conf.d directory, and in there you can customize all the PHP INI configs by putting custom, new files in there. Don't edit the master one, add your own and then you can easily spin up your new environment again by dropping these custom files in if you ever had to reconfigure your machine.
Matt Stauffer:
Chris, have you ever done video tutorials before?
Chris Brown:
I have done a few, yeah.
Matt Stauffer:
Would you be willing to consider doing a short video tutorial on all the most common customizations that someone might do in Valet? I want you to keep saying this, but I feel like this right here is a perfect video tutorial.
Chris Brown:
Sure, yeah. You're right. Yeah.
Matt Stauffer:
Even to the point where I might want to try and get you on Laracast to do an epo. We'll see.
Chris Brown:
Like a screen cast of some sort, yeah.
Matt Stauffer:
Somehow, some way I feel like that could be really helpful. But sorry, keep going.
Chris Brown:
Yeah, totally makes sense. Another one that I wanted to talk about is the idea that you can have custom extensions in Valet. So these are the ability for you to create your own custom commands. So you simply leverage the built-in application package that Valet is using itself, and you can create your own custom commands to do all kinds of things like configure MailHog or configure, actually even do proxying or create your own custom commands that you might want to contribute as a PR to Valet. It's a great way to stage and temporarily test these things without having to edit all the core code. Some of the features that are in Valet now started out like that.
Chris Brown:
Recently, I worked with Bo Simonsen to help create the Valet proxy command, which then allows you to proxy from Valet into Docker or into a traffic cluster in order to do simplified routing and stuff so that Valet's Dnsmasq configuration can all still be there using the same TLD so you don't have to have a custom TLD for your Docker environment to be able to do that sort of thing. So really handy.
Chris Brown:
You can see details about that in the PR. I'm pretty sure that's in the docs now as well. And then we have a diagnose command. Recently we worked together with some community contributions for a diagnose command. So if you type Valet diagnose, it'll go through and run all kinds of commands on your computer, copy all the output to the clipboard and you can paste that then into a GitHub Issue in order to help share the details about your operating system environment so we can troubleshot things that might be going on. That's useful for me or anyone else helping you, but if you actually go through and looked at the details that it's collected for yourself, very often you can find some weird anomalies in there, too.
Matt Stauffer:
Yeah.
Chris Brown:
And then-
Matt Stauffer:
That was a fun command to build, by the way.
Chris Brown:
It was, yeah. There's so many great things in there, great learnings of the underlying system. So earlier, I talked about people just not knowing the underlying details of how things work in your own computer, the internals of it. This is a great way to understand all the different moving parts that are involved in terms of how Valet works.
Matt Stauffer:
Yeah, totally.
Chris Brown:
The last thing to mention is Valet has an uninstall command, and it has two phases. There's a --force, which actually does the full cleanup, but if you just say Valet uninstall, it'll tell you all of the things that you should look at to do and commands you can run to do the uninstall. The --force will do a forceful delete of things, so it'll get rid of custom configs and stuff, too. I would say that's probably about a 95% cleanup that it can do. There's things that are custom configs it can't know about that you might have done, but it will do a pretty aggressive cleanup for you, so if you need to reset things for whatever reason, that's a really helpful place to start. And then do a Composer global update and get all its things in clean, modern state and reinstall if you are really having some terrible troubles with it. That's a bunch of tips and tricks.
Matt Stauffer:
Those are great tips, and I really appreciate those. I'm glad that you brought up the diagnose, because one of the things... I actually don't know if I've told the story. I don't think I have yet, of each of y'all and kind of your involvement here. So Jose told his story a little bit about kind of what it looked like for him to come to Docker, and obviously I actually don't know who made Laradock, but I know that Chris Fidao made Vessel, and Jose's been working at Tighten for awhile, but Jose's username everywhere is JoseCanHelp, and one of the reasons he came to our attention before he worked at Tighten is he was so friggen helpful all the time, and so him kind of choosing to be someone who just loves teaching people this kind of stuff totally makes sense. And Joe, I actually remember talking to Joe at PHP, what's it called? The Miami one.
Joe Ferguson:
Sunshine PHP.
Matt Stauffer:
Sunshine PHP.
Chris Brown:
Sunshine.
Matt Stauffer:
Yeah. Years ago, talking about him just saying, "You know what? I really want to contribute to the Laravel community, what does that look like?" And I was like, "Well, why don't you look around and find a project that makes sense to you? Where are you interested?" And he talked about Homestead and he just kind of went out and just said, "All right, I'm going to contribute to Homestead. I'm going to be helpful in Homestead." And he did, and now he's at the point where he's... I don't know if you're called the primary maintainer, but I certainly think of you the most when I think of Homestead.
Matt Stauffer:
And Chris, so Valet had been sitting dead for a couple years. Not dead, tons of people used it, but basically Adam Wathan and Taylor Otwell wrote Valet in a fit of just amazing creation, and then it was good enough for them and they just kind of didn't have enough time and energy amongst all their other projects to really work on it because it was working fine for them. So it just sat there for a couple years growing in issues, and I said, "You know what? Guys, would you be okay if I just kind of took over the maintenance of this?" Problem is, I don't have time nor the knowledge to really handle every single aspect of it. I at least was going to take the responsibility of responding to issues.
Matt Stauffer:
I knew Chris from meeting him at Laracon before and stuff like that, but it just kind of happened such that more and more and more he became more and more helpful. It got from the point where Chris would save my butt on something to the point where now I trust Chris more than I trust myself in knowing what's going on with Valet stuff. So even though I'm the one officially merging stuff, it's Chris's knowledge, Chris's expertise that is the one that's actually primarily responsible for the work that's happening in Valet. So while I'm the official maintainer of Valet right now, Chris is the real deal and he's the one who's making habit.
Matt Stauffer:
So it's very cool to me that each of you three kind of has a different story, but for each of you that story starts with you wanting to help people. I love that. That makes me really happy. None of you were the original appointed or official person for each of these technologies, but you have each kind of said, "I want to help. I want to be someone who teaches other people," and that's why you are where we are. It just makes me really happy to see that, so I just wanted to note that real quick before we move on. So thank you guys so much for your help to the community.
Jose Soto:
Awesome.
Matt Stauffer:
So Joe, what do you wish everyone knew about your system of choice?
Joe Ferguson:
Yeah, so the common thing that people seem to have problems with is how does this Vagrant thing work? What is a Vagrant box? I've found a lot of value in kind of breaking down what are these first few things that happen when you spin up a Vagrant box? What is actually happening? So Vagrant has a concept of boxes, and if you've ever used Vagrant, you're probably familiar that this box is a huge download that took forever, depending on your internet speed, because some of these Vagrant boxes can get pretty large.
Joe Ferguson:
Homestead's currently clocking in around a gig and a half, maybe a little bit more because we've bloated a little bit. We bloated up about a year and a half ago, and then we came back down and now we're starting to kind of bulk back up, but it's all about trade-offs and the features that we pack in there. A lot of what happens when you first spin up a Vagrant box, if you don't have the base box that is Homestead, when you try to spin up Homestead for the first time, Vagrant will go out into the internet and pull down, which is in a data store backed by S3, will pull down this base box for you. Your computer will download that base box and stick it in a hidden .vagrantd folder in your home folder.
Joe Ferguson:
Now, the next time you spin up a Vagrant machine, instead of downloading that box it will copy that box from where it downloaded into your home folder into your project folder. So now your Vagrant machine is running a copy of that Homestead image that is now your image. It is 100% yours, it's never going to be used by anybody else. It's only ever going to exist on your machine. Do what you want to it. I often tell people if you're interested in learning how Linux works or how web servers or PHP works under the hood, go play with Homestead, because you can't break it. Worst thing you can do is instructions unclear, I formatted my hard drive. You can destroy a Vagrant machine and do all kinds of terrible things to it and then your two commands, Vagrant destroy and Vagrant up back from getting that machine right back into where it was, at least where it was when somebody handed it to you, as long as you saved all your customizations.
Joe Ferguson:
So a lot of that is kind of making sure people are able to wrap their head around that, and when you do a Vagrant destroy, you delete the VM that was in your project folder, not the one that was in your Vagrant.d folder in your home folder. That's how you can spin up these VMs and destroy them so frivolously, where it's like, "Oh, no big deal. I'm just going to nuke this VM." Or you're just feeling kind of angsty one day and you're saying, "Today's the day that I'm going to RM/RF the server, and let me do that in Homestead so I keep my day job." That sort of thing. So there's the anger management aspect to Homestead as well.
Matt Stauffer:
It's like a punching bag.
Joe Ferguson:
Yeah, exactly. And it doesn't care. It's not going to get mad at you for deleting it. The other thing that I think is super important to note about Vagrant is your experience with Vagrant will vary and is so much up to the provider you choose. The providers are the virtualization technologies, the hypervisors of sort. There's Hyper-V, which is native to Windows 10 Professional, there's Parallels, which is MacOS only. There's a VirtualBox that is on every platform imaginable that is a free product, the other two are paid. Also, sorry, Hyper-V is free-ish, but it's paid as part of Windows, so not technically free. VirtualBox is free, open source, Parallels is a paid product, and VMware is also a paid product.
Joe Ferguson:
Something to note as well, if you're going to jump into the Vagrant ecosystem with VMware, because either your company is already heavily involved in VMware or you already have VMware licenses, you will need to buy a Vagrant VMware license, which allows you to connect Vagrant to your VMware technologies or your products, whether that's a workstation or a fusion, what have you. A little bit of a downer there, but most companies that are using VMware are already writing huge checks to VMware, so it's just another line item, not a big deal. But if you are a personal developer just trying to spend a little bit of money to get started in this, just note, VMware's a little bit more expensive to get into.
Joe Ferguson:
If you're on MacOS, I highly recommend checking out Parallels. Small disclaimer, they do give me an open source license, so I get to use their software to develop Homestead on. If they didn't give me a free license for doing Homestead, I would buy this product because that's how good of a hypervisor on MacOS it is. I wish it was multiplatform, but it's a really great hypervisor. The trade-off is the disc usage is a little bit higher than VirtualBox and VMware and some of the other providers. There's no solutions, there's only trade-offs as much in virtualization as anything else that we do as software engineers. But yeah, so how Vagrant boxes work and kind of the trade-offs with the providers is really the big thing that I wish more people knew or were more aware of when trying to diagnose or debug what their problems are with Vagrant.
Matt Stauffer:
Not to dive too deep in this, but I've always just told everybody just go with VirtualBox just because it's universal and easy and free, but I'm hearing you say that VirtualBox has some dismounting issues. So let's say money weren't a big issue, would you say if you're on Mac use Parallels and if you're on Windows use Hyper-V?
Joe Ferguson:
Pretty much. Now, the one pain point there is that Hyper-V does not expose the networking stack, so you don't have the ability to have Vagrant set your IP or network stack in the VM due to limitations from Microsoft on Hyper-V. They just haven't exposed those APIs yet.
Matt Stauffer:
Got it.
Joe Ferguson:
So that is a pain point on Hyper-V, but I will say Hyper-V is the fastest provider I've ever seen Vagrant run on, and my concerns around VirtualBox are mostly because there has been a longstanding bug in VirtualBox, the 60 branch as well as the 61 branch, that causes... It's essentially a file system latency issue on the shared file systems. Ultimately, it comes down to you could actually have really weird issues happen when you do Composer install because Composer will tell the file system that is being virtualized to, "Hey, write these files to this location." Well, the file system will write the data then report to the operating system, "Okay, I wrote that data," but the file system driver hasn't actually written the data to the shared disc yet, so when Composer continues on to its next operation, it's trying to access files that aren't there.
Joe Ferguson:
That is a bug that is still in VirtualBox that hasn't really been addressed because I have not had success exposing this bug to anyone at VirtualBox who wants to listen. So it's kind of a trade-off, and that's kind of why I've really started backing off recommending VirtualBox to people, is because it's almost to the point where it's more trouble than it's worth.
Matt Stauffer:
So let's say we were able to get somebody who listens to this podcast to get somebody at VirtualBox to listen and fix it.
Joe Ferguson:
I would love-
Matt Stauffer:
If that one bug was fixed, would you say VirtualBox for everybody?
Joe Ferguson:
Absolutely, because that's the biggest showstopper that I, as the maintainer of Homestead, can't solve, right?
Matt Stauffer:
Yeah.
Joe Ferguson:
Because when somebody opens up an issue on the Homestead repo, my job is, is this something that Homestead can affect? Is this a thing that Homestead can do? And more often than not, I don't have any access because it's either a Vagrant or it's a provider issue.
Matt Stauffer:
Sure.
Joe Ferguson:
Unfortunately, we're bound to a lot of other developers' products and commercial products and open source projects being successful for our project to be successful.
Matt Stauffer:
Right.
Joe Ferguson:
So yeah, I would love to talk to a file system nerd, because I don't understand file systems at all. I wish I'd had the ability to go contribute back to VirtualBox, but I don't.
Matt Stauffer:
Yeah. And last question there, if somebody were to go with VirtualBox across the board in RAM Composer, all their Composer commands on their host machine, does that solve the problem?
Joe Ferguson:
Absolutely. I am a big proponent of telling everybody, "Even though you're using Homestead, run NPM, run Composer, run all of that on your own machine, because I guarantee you, you have more cores and more RAM on your host machine than you do in the Vagrant machine."
Matt Stauffer:
Yeah. I think that's why I've always been recommending it, because we just kind of have that as a general policy, anyway. Even if there weren't that bug, it's just kind of like, "Run all those things in your host machine." "Okay, cool." All right, so that's-
Joe Ferguson:
Sorry.
Matt Stauffer:
Go ahead.
Joe Ferguson:
One last thing really quick. For every two people that run into VirtualBox bugs, there's thousands that don't, so don't let this be a complete distraction. Don't let this be a, "Don't use VirtualBox," just limit how much pain you're able to tolerate from VirtualBox is my advice.
Matt Stauffer:
Got it. Got it. All right. Jose, on to you. What do you wish everyone knew about using Docker in development?
Jose Soto:
I think I would like people to understand how simple it can be. It doesn't need to be complicated, it doesn't need to be complex. You can use Docker really as a tool to help you do things. One example that I'll bring is up during our Tighten offsite onsite this year, we had a little hackathon, and I wanted to generate a Gource video. If you don't know what Gource is, it's a visualization of editing a repository. So there's these little nodes that show up on the video, and everyone who touches a different node will show up on the screen. I wanted to generate that. I have Gource installed locally on my machine, but something was just not working. I don't know what library, where, somewhere in my machine just it wasn't compatible.
Jose Soto:
Instead of digging down and trying to figure this out, I saw that Gource offered a Docker image. So I literally pulled down the Docker image and within a couple of minutes was able to generate a video using this, and it was so much easier and so much less hassle than me having to figure out what exactly was wrong on my local system. Using Docker like that, it's fun and it shows me how simple it can be to use Docker to facilitate what I need to get done. It is kind of overwhelming at first when you hear about Docker, Docker in production and shipping in Docker and all this. It can get very complicated, but it doesn't need to be that way. I think that's one of the things I would love people to just understand.
Matt Stauffer:
That's great. Thanks guys, those are fantastic answers on those. As always, I can talk for hours, but we do need to start wrapping up so I have two more questions for each of you. The first one is, is there any one last thing you'd like to talk about this topic, and then the second one after that, which we'll ask after I get all three to the first questions, is what are some good ways for people to learn about this? Articles or docs or tutorials or anything. So first, is there any one last thing you'd like to cover that we haven't yet? And that's for Chris.
Chris Brown:
Yeah. So with Valet, I did kind of allude to this earlier, if you don't already spend some time getting to know Composer, get to know it. Understand how Composer works, especially be aware of what's in your Composer global configuration, and update your Composer global regularly. So run Composer global update on a relatively regular basis. I run it pretty much weekly. I run Composer self-update also weekly.
Chris Brown:
I also recommend upgrading your Homebrew on a regular basis. So run Brew upgrade I think it is. Yeah, Brew update just updates the Git repo but Brew upgrade actually will install pending updates that it knows about. If you're using or need to use a much older PHP version, don't be afraid to use a hybrid of all the things we're talking about today. Use Homestead, use Docker, use whatever works best for what you need in the moment, and don't feel like you need to stay stuck to one because you just don't maybe understand the other. Give it a try. They're not scary, they're not difficult. They maybe feel scary, but there's lots of value in checking it out, seeing whether it works, and use the right tool for the right job.
Matt Stauffer:
Thanks, Chris. That's good. What about you, Joe? Anything else?
Joe Ferguson:
Yeah. So like Chris was saying, don't be afraid to test anything or try out anything. Especially with Homestead, it's really easy to reset, it's really easy to break. You can break it as much as you want. I was talking about earlier that I do all kinds of terrible things to VMs. They don't care, they're just cattle. Remember, keep that in mind. Also, if you want to play with Docker ad you're new to Homestead, you can really confuse yourself by installing Docker in Homestead. That is a feature we support.
Matt Stauffer:
Oh, lord.
Joe Ferguson:
Which actually is probably better performance than Docker or desktop on MacOS, if that's a flame war we want to get into.
Matt Stauffer:
No. Now, that is interesting.
Joe Ferguson:
Yes. So yeah, don't be afraid to learn new things and play with new things, is something I always tell people, especially if you're curious about how a technology works or why... If you're sitting there listening to all this and you're going, "Why is that Joe guy so into Vagrant?" Go play with it. Go see what it's about, and then you can make your mind up on how crazy I am.
Matt Stauffer:
Either way, I've already made my mind up on that.
Joe Ferguson:
That's fine, too.
Matt Stauffer:
But yeah, good idea. And Jose, what about you?
Jose Soto:
I say yes, same as Chris and Joe are saying.
Matt Stauffer:
I love it.
Jose Soto:
Try it out. If you find that you have any issues or come across something that's too confusing, like my name says, I'm there to help. Tweet at me, hit me up, JoseCanHelp on Twitter. I'm always there to give some good advice, so just try it out.
Matt Stauffer:
Yeah. And I know all three of these guys will be happy to answer your questions, so I'll get their Twitter handles and websites and all that kind of stuff in just a second. Before we get there, for each of you, what are some good places for people to go learn about this topic, whether it's multiple articles or videos or just documentation, what's the best place, do you think, to learn about yours? So, Chris?
Chris Brown:
Valet's only real documentation is in the Laravel docs. So go to the Laravel documentation page and there's a whole section on Valet, and that's where we maintain it. If you see something that's missing there, feel free to open a PR or open an issue in the Valet repo and we'll talk about it and we can elaborate on the right contribution to make to the Laravel docs and you can have credit for that. So happy to support you in that process.
Matt Stauffer:
That's great. What about you, Joe?
Joe Ferguson:
Yeah. The Laravel docs are probably the best source of getting up-to-date on Homestead and figuring out Homestead. HashiCorp's vagrantup.com is the primary Vagrant site. You can learn a lot about Vagrant and how it works and how it works with providers going through that website. I'm also really active on the Laravel Discord channel, and there's a Homestead channel there that I monitor 24/7. I'm always around. If I'm not, I'm sleeping, so leave a message and I'll get back to you. But like Jose says, I feel compelled to go change my Twitter handle now to JoeCanHelpToo.
Jose Soto:
Yeah. Yeah.
Joe Ferguson:
I feel so overshadowed by Jose here.
Matt Stauffer:
I like that.
Jose Soto:
That's right.
Joe Ferguson:
No, I mean seriously, I love talking to Homestead users, I love seeing what people are doing with Homestead, I love going and browsing the forks of Homestead that people don't realize that we can see what they're doing in some cases or when they open a PR against the wrong fork and they open some fun changes against the Homestead repo. I always enjoy that because I like to see what people are doing with this thing that I've put so much and energy into. So yeah, feel free to reach out if you have any Vagrant questions, anything like that. I always like talking about VMs and virtualization, all that fun stuff with people.
Matt Stauffer:
Great. And Jose?
Jose Soto:
I absolutely plug Chris Fidao here, serversforhackers.com has a free course called Dockerizing Your Application. That, as well as shippingdocker.com are two of the bigger resources for me to finally get me over that hump of just like, "Oh, it makes sense to me."
Matt Stauffer:
Yeah.
Jose Soto:
So those are great. I do have a guest video on Laracast talking about managing your local development environment using Docker, definitely check that out. And I'm going to be posting some more videos to my own website at daytodaydocker.com. It has been a little quiet lately because of all the craziness that's going on, but there will be some more content coming up there.
Matt Stauffer:
Yep. And we will link all those things in the show notes, everybody. And a note in terms of Discord, there is a Valet Discord, but I will be honest that Chris and I both respond a lot more to GitHub Issues than we do the Discord. So it's sort of something I check in every couple of weeks, not something I live in. So the better place is definitely GitHub Issues for Valet.
Matt Stauffer:
Let's talk really quickly, one last thing before the fun moment of who created this? So I already acknowledged that Valet was originally created by Adam and Taylor. I assume that Taylor originally wrote Homestead. That's right, right?
Joe Ferguson:
That is correct, yes.
Matt Stauffer:
It is all Taylor? Okay, I didn't think it was a pair thing. And then so Vagrant's HashiCorp and Homebrew's by whoever the Homebrew team, everything like that, so a lot of those. Is Docker its own company?
Jose Soto:
Yes.
Matt Stauffer:
Okay, so Docker's by that... So really the main two are just Valet and Homestead, just want to acknowledge the people who originally created those and then the work that they put into those. I really appreciate you talking about Chris Fidao's work because it would have made sense for me to add Chris onto this group as well. Chris has been so influential in terms of how the Laravel community has been thinking about servers for years, and I would recommend that anybody who's interested in anything devops check out everything Chris does.
Matt Stauffer:
The only downside and the only criticism I have of Chris Fidao is that he's not as good as I wish he was about marketing his stuff because he's too humble. So I'm going to do it for him. Everything Chris Fidao has ever done is fantastic and more people should read his stuff, except for that one article about hexagonal architecture, which should be burned from the face of the internet.
Matt Stauffer:
All right, so personal fun moment. I've got a quick question for each of you, which is what is your favorite beverage in the world that is non-alcoholic? This can be the name of a specific beverage or a particular nuance or variant of it. So you can take a second and Chris, you can start when you're ready.
Chris Brown:
You know, this is going to sound maybe trite, and if you look at my physique you might disagree with me, but I'm a huge fan of just a high-quality protein shake with some greens in it and maybe some fresh veggies or fruit in it mixed together. It's one of the best energy boosts I find in the middle of the day or when I need to reset my creativity or something, and certainly when I'm exercising and stuff it just feels natural. But I think that's what I'm going to go with.
Matt Stauffer:
Nice. I like that.
Chris Brown:
Just a good, solid healthy something to boost energy and sugar levels and nutrition.
Matt Stauffer:
I love it. Joe, you got one?
Joe Ferguson:
Too easy. Black coffee, man. Makes my world go round.
Matt Stauffer:
How is your ideal black coffee brewed?
Joe Ferguson:
I will take coffee almost in any way I can get it.
Matt Stauffer:
Okay.
Joe Ferguson:
I do prefer the cold brew. During the summer once it gets a little bit warmer, I'll do cold brew in a french press, just kind of let it brew for about 24 hours. It's amazing. It's one of my favorites. Also there's a ton of different SAS or services out there where you can get coffee from all over the world. I highly recommend getting one of those services and exploring the realm of coffee.
Matt Stauffer:
And that was my next question for you is do you have a particular region that you're a big fan of?
Joe Ferguson:
Yes. All of them. All of the ones that have caffeine.
Matt Stauffer:
I love it. I love it. That's great. All right, Jose?
Jose Soto:
Yeah. Joe and I are going to get along just fine. Yeah. It's funny, I took a second to think about that question and I don't know why, because coffee is-
Matt Stauffer:
Yeah. I knew the answer.
Jose Soto:
Coffee is second life for me.
Matt Stauffer:
Okay, but brewing and source?
Jose Soto:
My preferred brewing method is pour over, easily. I actually just purchased the Chemex, so I'm diving into that a bit. But yeah, Chemex, French press, cold shots as a cappuccino or even an espresso. Any way you make coffee, I'll enjoy it. It's a great, great drink.
Matt Stauffer:
Nice. And do you have a particular region that you love or are you just kind of, "Give me the coffee"?
Jose Soto:
No. Any region, anywhere coffee is good.
Matt Stauffer:
Nice.
Jose Soto:
Yeah.
Matt Stauffer:
I like it. I'm going to answer this one, but I didn't think ahead of time so I feel kind of dumb, because I'm the one who asked the question, but the answer would have been one thing up until about three months ago, which was V60 pour over from Yirgacheffe is absolutely my favorite, and Yirgacheffe has been my favorite region for a long time. I am a big coffee nerd, but I'm not the type to nerd about regions so much, except every single time I've been blown away by a pour over, it's always been Yirgacheffe. And I went, "Okay, this is my region. This is my thing."
Matt Stauffer:
But my doctor has me off caffeine right now, and so I have been trying to explore other options. It has made me realize that I have been a sparkling water drinker since a kid, and there's this whole hotness right now with all those flavored sparkling waters. The interesting thing is, when I was a kid we would drink sparkling water, a glass of sparkling water with maybe an eighth of a glass of grape juice, and all the time that was one of our main things.
Matt Stauffer:
My mom would often do more grape juice than sparkling water, but I realized that I really like sparkling water with a little bit of flavor. Back in the '90s in the US, there was a ton of sparkling waters that had all this sugar and all this other crap in it, and I just sat there dreaming, like, "What if one day somebody would make a sparkling water out of the bottle, and all it has is just a tiny little bit of fruit juice in it or something like that?" So I actually do wish all of the ones that are really popular right now had a little bit of fruit juice versus the smell of fruit juice in them, but it's still better than anything that's been out there before, so I will say that the LaCroixs and all those, I laugh along with all the jokes about them just being like somebody sat some sparkling water a mile away from an orange tree or something. I wish they had a drop of orange juice in them or whatever. But I still, I realize sparkling water is one of my favorite things on the planet.
Joe Ferguson:
Good answer.
Matt Stauffer:
Thank you. Okay, so for each of you, I'd like for you to tell me, how can people follow you? What projects do you have going on? Even if you said them earlier, say them again. Is there anything they can buy from you, anything you're building or any websites or email lists or anything like that? How can people keep up with you?
Chris Brown:
Sure. I am not currently building anything and have nothing for sale, but you can certainly follow me on GitHub, I am DrByte, D-R-B-Y-T-E, and on twitter, DrByteZedC, that came from my Zen Cart days. So absolutely, follow me, I'm happy to help in any way I can. You'll not find me so active on Twitter, so GitHub's definitely the place to find me.
Matt Stauffer:
Okay. Joe?
Joe Ferguson:
Yeah, you can find me on Twitter @JoePFerguson, F-E-R-G-U-S-O-N. I also write monthly for PHP Architect Magazine, which is a magazine for the PHP community. I write a column called The Workshop, where every month I take a look at a technology or a product and kind of put it through its paces and talk about what I like, what works well, how to do a thing. I'm currently in the middle of a CodeIgniter series where I'm showing off the new CodeIgniter 4 stuff, so it's kind of been fun to go back to some of my early CodeIgniter days and revisit some of that stuff.
Joe Ferguson:
The article I'm working on right now is implementing Twig in CodeIgniter 4, so that's been kind of challenging myself to get a little bit more into the front end and make it sound like I know what I'm talking about, and I'm getting there.
Matt Stauffer:
I like that.
Joe Ferguson:
Yeah, so check out phparch.com for PHP Architect Magazine. There's a podcast you can subscribe to, check out the magazine, there's books as well. Full disclosure, my wife is one of their editors, so I kind of am plugged into PHP Arch pretty well.
Matt Stauffer:
Nice, I love it. And Jose?
Jose Soto:
Yeah, you can find me on Twitter @JoseCanHelp. I am also going to start creating more content for Docker-specific local development stuff at daytodaydocker.com, and yeah, mostly just Twitter. That's where you'll find me. GitHub, same, JoseCanHelp. Pretty much any platform if you search JoseCanHelp, I'll probably be there.
Matt Stauffer:
I love it. Thank you guys so much, and for everybody, all these links will be in the show notes, plus everything we've talked about, once I get this all edited together. That's it for today. So all three of you, thank you so much for joining me. It was a total pleasure for having you guys.
Jose Soto:
Thank you.
Joe Ferguson:
Thanks a lot.
Matt Stauffer:
All right. See you all next time.