Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multiarch build - add arm32v7 and arm64v8
- Loading branch information
1 parent
ae8d6e7
commit 9cbd5b4
Showing
7 changed files
with
146 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,9 @@ | ||
FROM jarischaefer/baseimage-ubuntu:3.0 | ||
FROM jarischaefer/baseimage-ubuntu:3.1 | ||
|
||
ARG COMPOSER_VERSION=1.10.20 | ||
ARG NET_IPV4_VERSION=1.3.5 | ||
ARG NET_IPV6_VERSION=174b5756d87627590a3c1624657bd32905addc4f | ||
ARG COMPOSER_VERSION | ||
ARG NET_IPV4_VERSION | ||
ARG NET_IPV6_VERSION | ||
|
||
RUN echo 'LANG=C.UTF-8' > /etc/default/locale && \ | ||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E5267A6C C300EE8C && \ | ||
echo 'deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main' > /etc/apt/sources.list.d/ondrej-php.list && \ | ||
apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get -yq dist-upgrade && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get -yq install --no-install-recommends \ | ||
dnsutils \ | ||
nginx \ | ||
php7.4-cli \ | ||
php7.4-fpm \ | ||
php7.4-mysql \ | ||
php7.4-gd \ | ||
php7.4-curl \ | ||
php7.4-opcache \ | ||
php7.4-ldap \ | ||
php7.4-mbstring \ | ||
php7.4-memcached \ | ||
php7.4-snmp \ | ||
php7.4-xml \ | ||
php7.4-zip \ | ||
php7.4-imagick \ | ||
php-pear \ | ||
snmp \ | ||
graphviz \ | ||
fping \ | ||
imagemagick \ | ||
whois \ | ||
mtr-tiny \ | ||
nagios-plugins \ | ||
nmap \ | ||
rrdcached \ | ||
rrdtool \ | ||
sendmail \ | ||
smbclient \ | ||
git \ | ||
sudo \ | ||
curl \ | ||
ipmitool \ | ||
acl \ | ||
vim-tiny \ | ||
unzip \ | ||
python3-ipaddr \ | ||
python3-mysqldb \ | ||
python3-memcache \ | ||
python3-pip \ | ||
python3-setuptools \ | ||
python3-psutil \ | ||
libodbc1 \ | ||
odbcinst \ | ||
snmptrapd \ | ||
mysql-client && \ | ||
curl -sSL -o - https://github.com/microsoft/msphpsql/releases/download/v5.9.0/Ubuntu2004-7.4.tar | tar -x -C /tmp && \ | ||
mv /tmp/Ubuntu2004-7.4/php_sqlsrv_74_nts.so /usr/lib/php/20190902/mssql.so && \ | ||
echo 'extension=mssql.so' > /etc/php/7.4/mods-available/mssql.ini && \ | ||
ln -s /etc/php/7.4/mods-available/mssql.ini /etc/php/7.4/cli/conf.d/30-mssql.ini && \ | ||
ln -s /etc/php/7.4/mods-available/mssql.ini /etc/php/7.4/fpm/conf.d/30-mssql.ini && \ | ||
\ | ||
curl -sSL -o - https://github.com/pear/Net_IPv4/archive/v${NET_IPV4_VERSION}.tar.gz | tar -xz -C /tmp && \ | ||
cd "/tmp/Net_IPv4-${NET_IPV4_VERSION}" && \ | ||
pear install package.xml && \ | ||
curl -sSL -o - https://github.com/pear/Net_IPv6/archive/${NET_IPV6_VERSION}.tar.gz | tar -xz -C /tmp && \ | ||
cd "/tmp/Net_IPv6-${NET_IPV6_VERSION}" && \ | ||
pear install package.xml && \ | ||
\ | ||
curl -sSL -o /usr/local/bin/composer "https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar" && \ | ||
chmod +x /usr/local/bin/composer && \ | ||
\ | ||
rm -rf /etc/nginx/sites-available/* /etc/nginx/sites-enabled/* && \ | ||
useradd librenms --home-dir /opt/librenms --system --shell /bin/bash && \ | ||
usermod -a -G librenms www-data && \ | ||
chmod u+s /usr/bin/fping /usr/bin/fping6 /usr/lib/nagios/plugins/check_dhcp /usr/lib/nagios/plugins/check_icmp && \ | ||
sed -i 's/session.*required.*pam_loginuid.so//g' /etc/pam.d/cron && \ | ||
\ | ||
apt-get -yq autoremove --purge && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/* && \ | ||
rm -f /var/log/dpkg.log /var/log/alternatives.log /var/log/bootstrap.log && \ | ||
rm -f /var/log/apt/history.log /var/log/apt/term.log && \ | ||
rm -rf /usr/share/man/* /usr/share/groff/* /usr/share/info/* && \ | ||
rm -rf /usr/share/lintian/* /usr/share/linda/* && \ | ||
find /usr/share/doc -not -type d -not -name 'copyright' -delete && \ | ||
find /usr/share/doc -type d -empty -delete | ||
ADD pre_install / | ||
|
||
RUN chmod +x /build/install && /build/install && rm -r /build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM --platform=linux/arm32v7 jarischaefer/baseimage-ubuntu:3.1-arm32v7 | ||
ADD qemu-arm-static /usr/bin | ||
|
||
ARG COMPOSER_VERSION | ||
ARG NET_IPV4_VERSION | ||
ARG NET_IPV6_VERSION | ||
|
||
ADD pre_install / | ||
|
||
RUN chmod +x /build/install && /build/install && rm -r /build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM --platform=linux/arm64v8 jarischaefer/baseimage-ubuntu:3.1-arm64v8 | ||
ADD qemu-aarch64-static /usr/bin | ||
|
||
ARG COMPOSER_VERSION | ||
ARG NET_IPV4_VERSION | ||
ARG NET_IPV6_VERSION | ||
|
||
ADD pre_install / | ||
|
||
RUN chmod +x /build/install && /build/install && rm -r /build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash -eu | ||
|
||
curl -qsSL "https://github.com/multiarch/qemu-user-static/releases/download/v5.2.0-2/qemu-arm-static.tar.gz" | tar -xz | ||
curl -qsSL "https://github.com/multiarch/qemu-user-static/releases/download/v5.2.0-2/qemu-aarch64-static.tar.gz" | tar -xz | ||
|
||
chmod 755 qemu-arm-static qemu-aarch64-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash -eu | ||
|
||
docker run --rm --privileged multiarch/qemu-user-static:register --reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/bin/bash -eu | ||
|
||
COMPOSER_VERSION=${COMPOSER_VERSION:-1.10.20} | ||
NET_IPV4_VERSION=${NET_IPV4_VERSION:-1.3.5} | ||
NET_IPV6_VERSION=${NET_IPV6_VERSION:-174b5756d87627590a3c1624657bd32905addc4f} | ||
|
||
echo 'LANG=C.UTF-8' > /etc/default/locale | ||
|
||
# Add PPAs | ||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E5267A6C C300EE8C | ||
echo 'deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main' > /etc/apt/sources.list.d/ondrej-php.list | ||
|
||
# Install dependencies | ||
apt-get update | ||
DEBIAN_FRONTEND=noninteractive apt-get -yq dist-upgrade | ||
DEBIAN_FRONTEND=noninteractive apt-get -yq install --no-install-recommends \ | ||
dnsutils \ | ||
nginx \ | ||
php7.4-cli \ | ||
php7.4-fpm \ | ||
php7.4-mysql \ | ||
php7.4-gd \ | ||
php7.4-curl \ | ||
php7.4-opcache \ | ||
php7.4-ldap \ | ||
php7.4-mbstring \ | ||
php7.4-memcached \ | ||
php7.4-snmp \ | ||
php7.4-xml \ | ||
php7.4-zip \ | ||
php7.4-imagick \ | ||
php-pear \ | ||
snmp \ | ||
graphviz \ | ||
fping \ | ||
imagemagick \ | ||
whois \ | ||
mtr-tiny \ | ||
nagios-plugins \ | ||
nmap \ | ||
rrdcached \ | ||
rrdtool \ | ||
sendmail \ | ||
smbclient \ | ||
git \ | ||
sudo \ | ||
curl \ | ||
ipmitool \ | ||
acl \ | ||
vim-tiny \ | ||
unzip \ | ||
python3-ipaddr \ | ||
python3-mysqldb \ | ||
python3-memcache \ | ||
python3-pip \ | ||
python3-setuptools \ | ||
python3-psutil \ | ||
libodbc1 \ | ||
odbcinst \ | ||
snmptrapd \ | ||
mysql-client | ||
|
||
# Install MSSQL driver for PHP | ||
curl -sSL -o - https://github.com/microsoft/msphpsql/releases/download/v5.9.0/Ubuntu2004-7.4.tar | tar -x -C /tmp | ||
mv /tmp/Ubuntu2004-7.4/php_sqlsrv_74_nts.so /usr/lib/php/20190902/mssql.so | ||
echo 'extension=mssql.so' > /etc/php/7.4/mods-available/mssql.ini | ||
|
||
# Install Net_IPv4 | ||
curl -sSL -o - https://github.com/pear/Net_IPv4/archive/v${NET_IPV4_VERSION}.tar.gz | tar -xz -C /tmp | ||
cd "/tmp/Net_IPv4-${NET_IPV4_VERSION}" | ||
pear install package.xml | ||
|
||
# Install Net_IPv6 | ||
curl -sSL -o - https://github.com/pear/Net_IPv6/archive/${NET_IPV6_VERSION}.tar.gz | tar -xz -C /tmp | ||
cd "/tmp/Net_IPv6-${NET_IPV6_VERSION}" | ||
pear install package.xml | ||
|
||
# Install composer | ||
curl -sSL -o /usr/local/bin/composer "https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar" | ||
chmod +x /usr/local/bin/composer | ||
|
||
# Configuration | ||
rm -rf /etc/nginx/sites-available/* /etc/nginx/sites-enabled/* | ||
sed -i 's/session.*required.*pam_loginuid.so//g' /etc/pam.d/cron | ||
|
||
# Permissions | ||
useradd librenms --home-dir /opt/librenms --system --shell /bin/bash | ||
usermod -a -G librenms www-data | ||
chmod u+s /usr/bin/fping /usr/bin/fping6 /usr/lib/nagios/plugins/check_dhcp /usr/lib/nagios/plugins/check_icmp | ||
|
||
# Cleanup | ||
apt-get -yq autoremove --purge | ||
apt-get clean | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/* | ||
rm -f /var/log/dpkg.log /var/log/alternatives.log /var/log/bootstrap.log | ||
rm -f /var/log/apt/history.log /var/log/apt/term.log | ||
rm -rf /usr/share/man/* /usr/share/groff/* /usr/share/info/* | ||
rm -rf /usr/share/lintian/* /usr/share/linda/* | ||
find /usr/share/doc -not -type d -not -name 'copyright' -delete | ||
find /usr/share/doc -type d -empty -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
architecture=$(uname -m) | ||
|
||
if [ "x86_64" == "$architecture" ]; then | ||
ln -sf /etc/php/7.4/mods-available/mssql.ini /etc/php/7.4/cli/conf.d/30-mssql.ini | ||
ln -sf /etc/php/7.4/mods-available/mssql.ini /etc/php/7.4/fpm/conf.d/30-mssql.ini | ||
else | ||
echo -e "\033[1;33mWARNING: MSPHPSQL is not available on ${architecture}\033[0m" >&2 | ||
fi |