Last active
December 18, 2022 10:10
-
-
Save ZCube/7bd1a4533f0b9e6778b49ed3e56d4428 to your computer and use it in GitHub Desktop.
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
FROM golang:1.19-bullseye AS golang-builder | |
RUN mkdir -p /opt/bitnami | |
ADD packages.sh /packages.sh | |
RUN chmod +x /packages.sh && \ | |
/packages.sh | |
FROM bitnami/apache:2.4.54 AS apache | |
FROM docker.io/bitnami/minideb:bullseye | |
ARG TARGETARCH | |
LABEL org.opencontainers.image.authors="https://github.com/ZCube/bitnami-compat" \ | |
org.opencontainers.image.description="Application repackaged by ZCube for arm64 compatible, originaly Bitnami" \ | |
org.opencontainers.image.ref.name="6.1.1-debian-11-r44" \ | |
org.opencontainers.image.source="https://github.com/ZCube/bitnami-compat" \ | |
org.opencontainers.image.title="wordpress" \ | |
org.opencontainers.image.vendor="ZCube" \ | |
org.opencontainers.image.version="6.1.1" | |
ENV HOME="/" \ | |
OS_ARCH="${TARGETARCH:-amd64}" \ | |
OS_FLAVOUR="debian-11" \ | |
OS_NAME="linux" | |
COPY prebuildfs / | |
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | |
# Install required system packages and dependencies | |
RUN install_packages acl ca-certificates curl less libaudit1 libbrotli1 libbsd0 libbz2-1.0 libcap-ng0 libcom-err2 libcrypt1 libcurl4 libexpat1 libffi7 libfftw3-double3 libfontconfig1 libfreetype6 libgcc-s1 libgcrypt20 libglib2.0-0 libgmp10 libgnutls30 libgomp1 libgpg-error0 libgssapi-krb5-2 libhogweed6 libicu67 libidn2-0 libjpeg62-turbo libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 liblcms2-2 libldap-2.4-2 liblqr-1-0 libltdl7 liblzma5 libmagickcore-6.q16-6 libmagickwand-6.q16-6 libmd0 libmemcached11 libncurses6 libnettle8 libnghttp2-14 libonig5 libp11-kit0 libpam0g libpcre2-8-0 libpcre3 libpng16-16 libpq5 libpsl5 libreadline8 librtmp1 libsasl2-2 libsodium23 libsqlite3-0 libssh2-1 libssl1.1 libstdc++6 libsybdb5 libtasn1-6 libtidy5deb1 libtinfo6 libunistring2 libuuid1 libwebp6 libx11-6 libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxslt1.1 libzip4 procps zlib1g | |
RUN echo install global | |
COPY --from=golang-builder /opt/bitnami/ /opt/bitnami/ | |
# refer : https://github.com/MariaDB/mariadb-docker | |
# license : GPL v2.0 | |
# https://github.com/MariaDB/mariadb-docker/blob/master/LICENSE | |
RUN install_packages gnupg | |
ARG GPG_KEYS=177F4010FE56CA3336300305F1656F24C74CD1D8 | |
# pub rsa4096 2016-03-30 [SC] | |
# 177F 4010 FE56 CA33 3630 0305 F165 6F24 C74C D1D8 | |
# uid [ unknown] MariaDB Signing Key <signing-key@mariadb.org> | |
# sub rsa4096 2016-03-30 [E] | |
RUN set -ex; \ | |
export GNUPGHOME="$(mktemp -d)"; \ | |
for key in $GPG_KEYS; do \ | |
gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys "$key"; \ | |
done; \ | |
gpg --batch --export $GPG_KEYS > /etc/apt/trusted.gpg.d/mariadb.gpg; \ | |
command -v gpgconf > /dev/null && gpgconf --kill all || :; \ | |
rm -fr "$GNUPGHOME"; \ | |
apt-key list | |
# bashbrew-architectures: amd64 arm64v8 ppc64le s390x | |
ARG MARIADB_MAJOR=10 | |
ENV MARIADB_MAJOR $MARIADB_MAJOR | |
ARG MARIADB_VERSION=1:10.6.11+maria~deb11 | |
ENV MARIADB_VERSION $MARIADB_VERSION | |
# release-status:RC | |
# (https://downloads.mariadb.org/mariadb/+releases/) | |
# Allowing overriding of REPOSITORY, a URL that includes suite and component for testing and Enterprise Versions | |
ARG REPOSITORY="http://archive.mariadb.org/mariadb-10.6.11/repo/debian/ bullseye main" | |
RUN set -e;\ | |
echo "deb ${REPOSITORY}" > /etc/apt/sources.list.d/mariadb.list; \ | |
{ \ | |
echo 'Package: *'; \ | |
echo 'Pin: release o=MariaDB'; \ | |
echo 'Pin-Priority: 999'; \ | |
} > /etc/apt/preferences.d/mariadb | |
# add repository pinning to make sure dependencies from this MariaDB repo are preferred over Debian dependencies | |
# libmariadbclient18 : Depends: libmysqlclient18 (= 5.5.42+maria-1~wheezy) but 5.5.43-0+deb7u1 is to be installed | |
# the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) | |
# also, we set debconf keys to make APT a little quieter | |
RUN set -ex; \ | |
apt-get update; \ | |
apt-get install -y \ | |
"mariadb-client=$MARIADB_VERSION" \ | |
; \ | |
rm -rf /var/lib/apt/lists/*; \ | |
# purge and re-create /var/lib/mysql with appropriate ownership | |
rm -rf /var/lib/mysql; | |
RUN mkdir -p /opt/bitnami/mysql/bin \ | |
&& mkdir -p /opt/bitnami/mysql/sbin \ | |
&& mkdir -p /opt/bitnami/mysql/lib \ | |
&& mkdir -p /opt/bitnami/mysql/conf \ | |
&& ln -s /usr/bin/my* /opt/bitnami/mysql/bin/ \ | |
&& ln -s /usr/sbin/my* /opt/bitnami/mysql/sbin/ \ | |
&& ln -s /usr/bin/maria* /opt/bitnami/mysql/bin/ \ | |
&& ln -s /usr/sbin/maria* /opt/bitnami/mysql/sbin/ \ | |
&& rm -rf /etc/mysql/my.cnf \ | |
&& rm -rf /etc/mysql/mysql.cnf \ | |
&& chown 1001:1001 -R /opt/bitnami/mysql \ | |
&& touch /opt/bitnami/mysql/conf/my.cnf \ | |
&& ln -sf /opt/bitnami/mysql/conf/my.cnf /etc/mysql/my.cnf \ | |
&& rm -f /opt/bitnami/mysql/conf/my.cnf | |
RUN install_packages php curl php-pear composer php-mysql php-pgsql php-fpm | |
RUN ln -sf /usr/sbin/php-fpm$(php -v | grep ^PHP | cut -d' ' -f2 | cut -d'.' -f1).$(php -v | grep ^PHP | cut -d' ' -f2 | cut -d'.' -f2) /usr/sbin/php-fpm | |
RUN mkdir -p /opt/bitnami/php/bin \ | |
&& mkdir -p /opt/bitnami/php/sbin \ | |
&& mkdir -p /opt/bitnami/php/lib \ | |
&& mkdir -p /opt/bitnami/php/etc \ | |
&& mkdir -p /opt/bitnami/php/lib/php/extensions/ \ | |
&& ln -s /usr/bin/php* /opt/bitnami/php/bin/ \ | |
&& ln -s /usr/bin/pear* /opt/bitnami/php/bin/ \ | |
&& ln -s /usr/bin/phar* /opt/bitnami/php/bin/ \ | |
&& ln -s /usr/bin/composer* /opt/bitnami/php/bin/ \ | |
&& ln -sf /usr/sbin/php* /opt/bitnami/php/sbin/ \ | |
&& ln -sf /usr/sbin/pear* /opt/bitnami/php/sbin/ \ | |
&& ln -sf /usr/sbin/phar* /opt/bitnami/php/sbin/ \ | |
&& ln -sf /usr/sbin/composer* /opt/bitnami/php/sbin/ \ | |
&& ln -sf $(php -r 'echo ini_get("extension_dir");')/* /opt/bitnami/php/lib/php/extensions/ \ | |
&& chown 1001:1001 -R /opt/bitnami/php | |
RUN cd /tmp \ | |
&& curl -LO https://downloads.bitnami.com/files/stacksmith/php-8.1.13-2-linux-amd64-debian-11.tar.gz \ | |
&& tar -xzf php-8.1.13-2-linux-amd64-debian-11.tar.gz -C /tmp --strip-components=1 \ | |
&& cp -rf /tmp/files/php/etc/* /opt/bitnami/php/etc/ \ | |
&& chown 1001:1001 -R /opt/bitnami/php \ | |
&& rm -rf /tmp/* | |
COPY --from=bitnami/wordpress:6.1.1 /opt/bitnami/wordpress/ /opt/bitnami/wordpress/ | |
COPY --from=bitnami/wordpress:6.1.1 /opt/bitnami/wp-cli/ /opt/bitnami/wp-cli/ | |
RUN install_packages libaprutil1-ldap libldap-common apache2 libapache2-mod-security2 libmodsecurity3 libmodsecurity-dev | |
COPY --from=apache /opt/bitnami/apache/conf/ /opt/bitnami/apache/conf/ | |
RUN mkdir -p /opt/bitnami/apache/bin \ | |
&& mkdir -p /opt/bitnami/apache/sbin \ | |
&& mkdir -p /opt/bitnami/apache/lib \ | |
&& mkdir -p /opt/bitnami/apache/conf \ | |
&& ln -sf /usr/bin/ab /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/apachectl /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/apr-1-config /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/apu-1-config /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/apxs /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/checkgid /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/dbmmanage /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/envvars /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/envvars-std /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/fcgistarter /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/htcacheclean /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/htdbm /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/htdigest /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/htpasswd /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/httpd /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/httxt2dbm /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/logresolve /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/rotatelogs /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/bin/rules-updater.pl /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/ab /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/apachectl /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/apr-1-config /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/apu-1-config /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/apxs /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/checkgid /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/dbmmanage /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/envvars /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/envvars-std /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/fcgistarter /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/htcacheclean /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/htdbm /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/htdigest /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/htpasswd /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/httpd /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/httxt2dbm /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/logresolve /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/rotatelogs /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/rules-updater.pl /opt/bitnami/apache/bin/ \ | |
&& ln -sf /usr/sbin/apache2 /opt/bitnami/apache/bin/httpd \ | |
&& ln -sf /usr/lib/apache2/modules /opt/bitnami/apache/ \ | |
&& sed -i 's,^\(LoadModule log_config_module modules/mod_log_config.so\),#\1,g' /opt/bitnami/apache/conf/httpd.conf \ | |
&& sed -i 's,^\(LoadModule version_module modules/mod_version.so\),#\1,g' /opt/bitnami/apache/conf/httpd.conf \ | |
&& sed -i 's,^\(LoadModule unixd_module modules/mod_unixd.so\),#\1,g' /opt/bitnami/apache/conf/httpd.conf \ | |
&& chown 1001:1001 -R /opt/bitnami/apache | |
RUN install_packages libphp-embed libapache2-mod-php | |
RUN cp -rfL /usr/lib/apache2/modules/libphp$(php -v | grep ^PHP | cut -d' ' -f2 | cut -d'.' -f1).$(php -v | grep ^PHP | cut -d' ' -f2 | cut -d'.' -f2).so /usr/lib/apache2/modules/libphp$(php -v | grep ^PHP | cut -d' ' -f2 | cut -d'.' -f1).so | |
RUN apt-get autoremove --purge -y curl && \ | |
apt-get update && apt-get upgrade -y && \ | |
apt-get clean && rm -rf /var/lib/apt/lists /var/cache/apt/archives | |
RUN chmod g+rwX /opt/bitnami | |
COPY rootfs / | |
RUN /opt/bitnami/scripts/mysql-client/postunpack.sh | |
RUN /opt/bitnami/scripts/apache/postunpack.sh | |
RUN /opt/bitnami/scripts/php/postunpack.sh | |
RUN /opt/bitnami/scripts/apache-modphp/postunpack.sh | |
RUN /opt/bitnami/scripts/wordpress/postunpack.sh | |
RUN /opt/bitnami/scripts/wp-cli/postunpack.sh | |
ENV APACHE_HTTPS_PORT_NUMBER="" \ | |
APACHE_HTTP_PORT_NUMBER="" \ | |
APP_VERSION="6.1.1" \ | |
BITNAMI_APP_NAME="wordpress" \ | |
PATH="/opt/bitnami/common/bin:/opt/bitnami/php/bin:/opt/bitnami/php/sbin:/opt/bitnami/apache/bin:/opt/bitnami/wp-cli/bin:/opt/bitnami/mysql/bin:$PATH" | |
EXPOSE 8080 8443 | |
USER 1001 | |
ENTRYPOINT [ "/opt/bitnami/scripts/wordpress/entrypoint.sh" ] | |
CMD [ "/opt/bitnami/scripts/apache/run.sh" ] |
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
#!/bin/bash | |
set -e | |
export PACKAGE=render-template | |
export TARGET_DIR=common | |
export VERSION=1.0.4 | |
export REF=v${VERSION} | |
export CGO_ENABLED=0 | |
rm -rf ${PACKAGE} || true | |
mkdir -p ${PACKAGE} | |
git clone -b "${REF}" https://github.com/bitnami/render-template ${PACKAGE} | |
pushd ${PACKAGE} | |
go mod download | |
go build -v -ldflags '-d -s -w' . | |
mkdir -p /opt/bitnami/${TARGET_DIR}/licenses | |
mkdir -p /opt/bitnami/${TARGET_DIR}/bin | |
cp -f COPYING /opt/bitnami/${TARGET_DIR}/licenses/${PACKAGE}-${VERSION}.txt | |
cp -f ${PACKAGE} /opt/bitnami/${TARGET_DIR}/bin/${PACKAGE} | |
popd | |
rm -rf ${PACKAGE} | |
#!/bin/bash | |
set -e | |
export PACKAGE=gosu | |
export TARGET_DIR=common | |
export VERSION=1.14.0 | |
export REF=1.14 | |
export CGO_ENABLED=0 | |
rm -rf ${PACKAGE} || true | |
mkdir -p ${PACKAGE} | |
git clone -b "${REF}" https://github.com/tianon/gosu ${PACKAGE} | |
pushd ${PACKAGE} | |
go mod download | |
go build -v -ldflags '-d -s -w' . | |
mkdir -p /opt/bitnami/${TARGET_DIR}/licenses | |
mkdir -p /opt/bitnami/${TARGET_DIR}/bin | |
cp -f LICENSE /opt/bitnami/${TARGET_DIR}/licenses/${PACKAGE}-${VERSION}.txt | |
cp -f ${PACKAGE} /opt/bitnami/${TARGET_DIR}/bin/gosu | |
popd | |
rm -rf ${PACKAGE} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment