Skip to content

Instantly share code, notes, and snippets.

@antunderwood
Last active December 30, 2021 14:38
Show Gist options
  • Save antunderwood/afc81f8fb7dbcec64b01cc807b491765 to your computer and use it in GitHub Desktop.
Save antunderwood/afc81f8fb7dbcec64b01cc807b491765 to your computer and use it in GitHub Desktop.

Start alpine docker image

docker run -it alpine /bin/sh

Install dependencies

apk update
apk add bash build-base curl file git gzip libc6-compat ncurses ruby ruby-dbm ruby-etc ruby-irb ruby-json sudo

Create a user

adduser -D -s /bin/bash linuxbrew
echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers
su -l linuxbrew

Install Linuxbrew/brew

sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
PATH=$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH

Update Linuxbrew

brew update
brew doctor
@DivineDominion
Copy link

@aunderwo which Alpine version did you use?

First, the ruby-dbm package isn't found. Trying to get anywhere without it, next the installation step warns about the new canonical location:

Warning: Linuxbrew has been merged into Homebrew.
Please migrate to the following command:
  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Finally, the tools aren't actually used/found on the system or the dependencies don't match:

alpine:~$   /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
musl libc (aarch64)
Version 1.2.2
Dynamic Program Loader
Usage: /lib/ld-musl-aarch64.so.1 [options] [--] pathname
Homebrew requires Ruby 2.6 which was not found on your system.
Homebrew portable Ruby requires Glibc version 2.13 or newer,
and your Glibc version is too old. See:
  https://docs.brew.sh/Homebrew-on-Linux#requirements
Please install Ruby 2.6 and add its location to your PATH.

I wonder how you made this work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment