I get Lando, You get Lando, Everybody gets…

Running Lando from source

On Alpine Windows Subsystem for Linux

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

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Your Guide To State In React - A UI Example

What is TDZ? from var to let and const ( JavaScript ES6)

useBrowserStorage

EXPath and Asynchronous HTTP

Ionic 3 — Fast mobile development

Babel Crash Course

Quasar Framework — a SSR+PWA app with dynamic data.

My Experience Learning JavaScript Through an Online Course

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store

Callback Insanity

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

More from Medium

readyz and livez: Getting started with Kubernetes health endpoints using NodeJS/Express

Ackee Node.js Optimized GitLab CI Runners

Open Source Phase-Eassy Week 12

Reviewing Grafana Loki for Log aggregation