Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated and Improved install scripts. #3006

Merged
merged 3 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions build/alpine/install-packages.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh

set -e
set -o pipefail
keepittechie marked this conversation as resolved.
Show resolved Hide resolved

# Install necessary packages
apk add --no-cache -U \
openssl \
imagemagick \
Expand All @@ -14,7 +14,8 @@ apk add --no-cache -U \
procps \
shadow \
bash \
curl iputils \
curl \
iputils \
git \
jq \
mysql-client \
Expand All @@ -29,11 +30,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
30 changes: 20 additions & 10 deletions build/ol/install-gosu.sh
Original file line number Diff line number Diff line change
@@ -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
31 changes: 21 additions & 10 deletions build/ol/install-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -26,7 +31,6 @@ dnf install -y \
iputils \
curl \
git \
git-lfs \
jq \
dos2unix \
mysql \
Expand All @@ -42,18 +46,25 @@ 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
keepittechie marked this conversation as resolved.
Show resolved Hide resolved
keepittechie marked this conversation as resolved.
Show resolved Hide resolved
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
17 changes: 11 additions & 6 deletions build/ubuntu/install-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export TARGET

set -euo pipefail

# Update and install packages
apt-get update

DEBIAN_FRONTEND=noninteractive \
apt-get install -y \
imagemagick \
Expand All @@ -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