I get Lando, You get Lando, Everybody gets…

Running Lando from source

On Alpine Windows Subsystem for Linux

Callback Insanity
4 min readMar 16, 2021
Photo by Luca Bravo on Unsplash

Yesterday morning I wrote an article on installing Lando into Ubuntu WSL 2, using the latest and greatest Docker Desktop (release 3.2.x).

If you are one of the 3 anonymous cats and 1 rottweiler dog that follows this blog, you probably figured out that I’d be a matter of when, not if I would attempt the same on Alpine.

I’m happy to report that it looks like the approach detailed in this story was successful. Earlier today I had tried to install Lando from a .deb package in Alpine, and that ended up being a horror story of which I’ll spare you the details.

Pre-requisites

The following dependencies need to be installed in Alpine in order to proceed:

  1. Yarn
  2. Node.js
  3. Git
sudo apk add git yarn nodejs

WARNING: Your WSL distro has access to, and will indeed call both Node.js and Yarn if they are installed in your host Windows machine. This is not what you want.

For example, see how Alpine can call Yarn on the Windows host here:

This isn’t a pretty picture.

However, if you have in fact installed Yarn inside your WSL distro, the distro binary will supercede the Windows host binary:

Make sure binaries for yarn and node are located on the WSL distro itself.

Installing Lando

Clone git repo from https://github.com/lando/lando:

git clone https://github.com/lando/lando.git

Run yarn install command:

Run Lando command with node bin/lando.js:

Create symlink to the Lando executable in a PATH-visible location such as /usr/local/bin :

sudo ln -s /home/wsl/lando/bin/lando.js /usr/local/bin/lando

Then simply run lando:

Warnings Fus Ro Dah!

According to the GNU manual for the env utility you should be able to specify arguments for the program invoked in the shebang, however that depends on the platform.

However, as Alpine thinks it’s Gerard Butler on 300, we’re rather well…Spartan:

And the full suite of options for GNU env is not available in our WSL mini-Laconia. Therefore this quick fix will do it:

# Add this to your ~/.bashrc# SUPPRESS WARNINGS ON LANDO SOURCE
export NODE_NO_WARNINGS=1

And on bin/lando.js remove the no warnings argument from the environment invocation shebang:

# Change shebang from:
#!/usr/bin/env node --no-warnings
# To:
#!/usr/bin/env node

Trusting the CA

Updated November 7, 2021

To get rid of the pesky warnings from the browser about not trusting the Lando’s SSL certificate, you can follow the instructions here.

In my case, I need to copy the certificate from the Lando source into the Windows host machine:

Copy certificate from WSL into Windows

Once the certificate is in Windows-land, I can add or remove it using an elevated-privilege command prompt:

# Add the Lando CA
certutil -addstore -f "ROOT" C:\Users\ME\.lando\certs\lndo.site.pem
# Remove Lando CA
certutil -delstore "ROOT" serial-number-hex

And after refreshing the Lando site, the red cross over https has been removed from the address bar:

Success: Connection is SECURE

DNS_PROBE_FINISHED_NXDOMAIN

If for some reason the browser cannot find the .lndo.site domain, just check the instructions over here to rebind your DNS from your local ISP into Google or Cloudfare. If you cannot do it from the browser try updating the connection properties.

Reference

Additional Resources

--

--

Callback Insanity

Organic, fair-sourced DevOps and Full-Stack things. This is a BYOB Establishment — Bring Your Own hipster Beard.