Updated and Improved install scripts. (#3006)

This commit is contained in:
Josh 2024-07-21 13:40:59 -07:00 committed by GitHub
parent b393b22136
commit de1d7f422c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 62 additions and 29 deletions

View file

@ -3,6 +3,7 @@
set -e
set -o pipefail
# Install necessary packages
apk add --no-cache -U \
openssl \
imagemagick \
@ -14,7 +15,8 @@ apk add --no-cache -U \
procps \
shadow \
bash \
curl iputils \
curl \
iputils \
git \
jq \
mysql-client \
@ -29,11 +31,15 @@ apk add --no-cache -U \
libwebp \
libcap
# Patched knockd
# Download and install patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-alpine-amd64.tar.gz
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
setcap cap_net_raw=ep /usr/local/sbin/knockd
# Set git credentials
echo -e "[user]\n name = Minecraft Server on Docker\n email = server@example.com" >> /etc/gitconfig
# Set Git credentials globally
cat <<EOF >> /etc/gitconfig
[user]
name = Minecraft Server on Docker
email = server@example.com
EOF

View file

@ -1,12 +1,22 @@
#!/bin/bash
if [[ $(uname -m) == "aarch64" ]]; then
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64
chmod +x /bin/gosu
elif [[ $(uname -m) == "x86_64" ]]; then
curl -sL -o /bin/gosu https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64
chmod +x /bin/gosu
else
echo "Not supported!"
exit 1
fi
set -euo pipefail
GOSU_VERSION="1.16"
GOSU_BASE_URL="https://github.com/tianon/gosu/releases/download/$GOSU_VERSION"
case $(uname -m) in
"aarch64")
GOSU_ARCH="gosu-arm64"
;;
"x86_64")
GOSU_ARCH="gosu-amd64"
;;
*)
echo "Architecture not supported!"
exit 1
;;
esac
curl -sL -o /bin/gosu "${GOSU_BASE_URL}/${GOSU_ARCH}"
chmod +x /bin/gosu

View file

@ -4,20 +4,25 @@ export TARGET
set -euo pipefail
# Install and configure dnf
microdnf install dnf -y
dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled ol8_codeready_builder
tee /etc/yum.repos.d/ol8-epel.repo<<EOF
# Add EPEL repository
tee /etc/yum.repos.d/ol8-epel.repo <<EOF
[ol8_developer_EPEL]
name= Oracle Linux \$releasever EPEL (\$basearch)
name=Oracle Linux \$releasever EPEL (\$basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/developer/EPEL/\$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
EOF
# Update system
dnf update -y
# Install necessary packages
dnf install -y \
ImageMagick \
file \
@ -26,7 +31,6 @@ dnf install -y \
iputils \
curl \
git \
git-lfs \
jq \
dos2unix \
mysql \
@ -42,18 +46,26 @@ dnf install -y \
findutils \
which
# Install Git LFS
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash
dnf update -y
dnf install -y \
git-lfs
dnf install -y git-lfs
# Clean up DNF when done
dnf clean all
# Install gosu (assuming the script /build/ol/install-gosu.sh exists and is executable)
bash /build/ol/install-gosu.sh
# Patched knockd
# Download and install patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
setcap cap_net_raw=ep /usr/local/sbin/knockd
# Set git credentials
echo -e "[user]\n name = Minecraft Server on Docker\n email = server@example.com" >> /etc/gitconfig
# Set git credentials globally
cat <<EOF >> /etc/gitconfig
[user]
name = Minecraft Server on Docker
email = server@example.com
EOF

View file

@ -4,8 +4,8 @@ export TARGET
set -euo pipefail
# Update and install packages
apt-get update
DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
imagemagick \
@ -29,19 +29,24 @@ apt-get install -y \
libpcap0.8 \
webp
# Install Git LFS
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
apt-get update
apt-get install -y \
git-lfs
apt-get install -y git-lfs
# Clean up APT when done
apt-get clean
# Patched knockd
# Download and install patched knockd
curl -fsSL -o /tmp/knock.tar.gz https://github.com/Metalcape/knock/releases/download/0.8.1/knock-0.8.1-$TARGET.tar.gz
tar -xf /tmp/knock.tar.gz -C /usr/local/ && rm /tmp/knock.tar.gz
ln -s /usr/local/sbin/knockd /usr/sbin/knockd
setcap cap_net_raw=ep /usr/local/sbin/knockd
find /usr/lib -name 'libpcap.so.0.8' -execdir cp '{}' libpcap.so.1 \;
# Set git credentials
echo -e "[user]\n name = Minecraft Server on Docker\n email = server@example.com" >> /etc/gitconfig
# Set git credentials globally
cat <<EOF >> /etc/gitconfig
[user]
name = Minecraft Server on Docker
email = server@example.com
EOF