EmbarkStudios / wg-ui

WireGuard Web UI for self-serve client configurations, with optional auth.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing Python2 dependency in node:12-alpine when build of sass is required

ikaruswill opened this issue · comments

Describe the bug
This is more of a suggestion for your Dockerfile based on my experience with building wg-ui for non-amd64 architectures..

First off, thanks for creating wg-ui, it's a sorely needed piece of software when it comes to encouraging widespread adoption of Wireguard.

I have my own pipeline building the arm Docker image for wg-ui, and I noticed a very welcome change of integrating the build steps into the Docker image. I tried purely depending on the revised Dockerfile to build the arm image but I noticed an error that I've encountered before whilst developing my own pipeline:

...
gyp verb command clean []
--
152 | gyp verb clean removing "build" directory
153 | gyp verb command configure []
154 | gyp verb check python checking for Python executable "python2" in the PATH
155 | gyp verb `which` failed Error: not found: python2
156 | gyp verb `which` failed     at getNotFoundError (/ui/node_modules/which/which.js:13:12)
...

That's mainly because the base image used here

FROM docker.io/node:12-alpine AS ui
does not have Python2.

Proposed solution
To get around this I used node:latest or node:12 instead as the base image during the build step

Justification
There should be no real reason to use alpine versions of images when using them as build steps, especially when building requires quite a wide range of tools.

To Reproduce
Steps to reproduce the behavior:

  1. Use a non-amd64 device such as a Raspberry Pi
  2. Clone the repository
  3. Run docker build .
  4. Check stdout for build failure after sass fails to download for your architecture

Expected behavior
Build should succeed without any hiccups (as long as the node:12 image is used)

Screenshots
Not applicable

Device:

  • OS: Linux
  • Arch: Arm64
  • Browser: NA
  • Version [e.g. 22]

Additional context
NA

I'll submit a PR for this.