By using AWS re:Post, you agree to the Terms of Use

How do I install Homebrew through the command config?

0

Hi! I'm just getting started with Beanstalk so apologies if this is a trivial question. I'm trying to install Homebrew onto my Beanstalk application's instances, and I've unsuccessfully been trying to install Homebrew using a custom Linux command in a .config file.

I'm using the online reference here (https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#linux-commands) and I'm trying to install Homebrew with the command described here (https://brew.sh/).

Here is my homebrew.config file:

commands:
install_homebrew:
command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

The error I'm getting is:

2020-08-10 04:09:35 ERROR [Instance: i-096f98d15abfff217] Command failed on instance. Return code: 127 Output: /bin/bash: line 31: HOME: unbound variable.

And the offending line is:

HOMEBREW_CACHE="${HOME}/.cache/Homebrew"

I'm confused because I thought every Linux instance by default will have the HOME variable set. How can I get variables like HOME to be automatically set for Beanstalk .config commands?

Edited by: hardcode on Aug 11, 2020 12:00 AM

Edited by: hardcode on Aug 12, 2020 11:25 AM

asked 2 years ago29 views
2 Answers
0

Decided to just use an AMI.

answered 2 years ago
0

Could maybe try bash -lc to ensure it's a login shell.

https://qiita.com/ymm1x/items/8eba92e15420715e9a2f also has an example of how to check what's exported for your beanstalk platform. Not sure, but it might vary a little between platforms.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions