Skip to content

Instantly share code, notes, and snippets.

@mtsukamoto
Created March 4, 2024 08:35
Show Gist options
  • Save mtsukamoto/842f74aaf100a7887cf374da7f8cf77c to your computer and use it in GitHub Desktop.
Save mtsukamoto/842f74aaf100a7887cf374da7f8cf77c to your computer and use it in GitHub Desktop.
Amazon Linux 2023 (ARM) userdata to install budibase
#!/bin/bash -xe
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
export HOME="/root"
dnf update -y
dnf upgrade --releasever=2023.3.20240117 -y
# install docker
dnf install -y docker
systemctl enable --now docker
usermod -aG docker ec2-user
# install docker-compose
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.24.1/docker-compose-linux-aarch64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
# install node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
. ~/.nvm/nvm.sh
nvm install --lts
# install budibase
npm install -g @budibase/cli
budi --version
@mtsukamoto
Copy link
Author

ARM版Amazon Linux 2023上に、ローコード開発環境budibase参考)のセルフホスティング環境をインストールするユーザーデータです。
ARM(≒Graviton系EC2インスタンス)用なのは、16行目でdocker-composeを取得する際にARM用( aarch64)を指定しているからなので、Intel系ではその辺をよしなに書き換えてもらえれば動くかと。

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