Updated for build ARM

This commit is contained in:
Pavel@Vostro5468 2021-12-31 13:45:07 +03:00
parent fe0b5cfd37
commit b601bd365f
9 changed files with 76 additions and 54 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/images

View File

@ -1,12 +1,30 @@
FROM ubuntu:18.04 FROM ubuntu:18.04
ENV php_version=7.4
COPY ["timezone", "localtime", "/etc/"] COPY ["timezone", "localtime", "/etc/"]
RUN apt update -y \ RUN apt update -y \
&& apt-get install gnupg gnupg1 gnupg2 software-properties-common -y \ && apt-get install gnupg gnupg1 gnupg2 software-properties-common -y \
&& apt-add-repository ppa:ondrej/php \ && apt-add-repository ppa:ondrej/php \
&& apt-get update -y \ && apt-get update -y \
&& apt-get install apache2 php php-soap php-snmp php-mysql php-curl php-ldap php-xml php-mbstring php-oauth php-gd cron -y \ && apt-get install -y apache2 \
php${php_version} \
php${php_version}-soap \
php${php_version}-snmp \
php${php_version}-mysql \
php${php_version}-curl \
php${php_version}-ldap \
php${php_version}-xml \
php${php_version}-mbstring \
php${php_version}-oauth \
php${php_version}-gd \
php${php_version}-igbinary \
php${php_version}-memcached \
php${php_version}-msgpack \
php${php_version}-oauth \
php${php_version}-zip \
cron \
&& apt-get purge gnupg gnupg1 gnupg2 software-properties-common -y \ && apt-get purge gnupg gnupg1 gnupg2 software-properties-common -y \
&& apt-get autoremove -y \ && apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
@ -15,6 +33,7 @@ RUN apt update -y \
COPY docker-entrypoint.sh / COPY docker-entrypoint.sh /
COPY 000-default.conf /etc/apache2/sites-available COPY 000-default.conf /etc/apache2/sites-available
WORKDIR /var/www/hmtl
EXPOSE 80 EXPOSE 80
CMD ["/docker-entrypoint.sh"] CMD ["/docker-entrypoint.sh"]

View File

@ -1,17 +0,0 @@
FROM debian
RUN apt update -y \
&& apt-get install apache2 php php-soap php-snmp php-mysql php-curl php-ldap php-xml php-mbstring php-oauth php-gd cron -y \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/www/html/* \
&& a2enmod rewrite
COPY docker-entrypoint.sh /
COPY 000-default.conf /etc/apache2/sites-available
EXPOSE 80
CMD ["/docker-entrypoint.sh"]

View File

@ -1,24 +0,0 @@
#!/bin/bash
if [ $# -eq 1 ]
NM=`uname -a && date`
NAME=`echo $NM | md5sum | cut -f1 -d" "`
then
ppa_name=`echo "$1" | cut -d":" -f2 -s`
if [ -z "$ppa_name" ]
then
echo "PPA name not found"
echo "Utility to add PPA repositories in your debian machine"
echo "$0 ppa:user/ppa-name"
else
echo "$ppa_name"
echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu xenial main" >> /etc/apt/sources.list
apt-get update >> /dev/null 2> /tmp/${NAME}_apt_add_key.txt
key=`cat /tmp/${NAME}_apt_add_key.txt | cut -d":" -f6 | cut -d" " -f3`
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
rm -rf /tmp/${NAME}_apt_add_key.txt
fi
else
echo "Utility to add PPA repositories in your debian machine"
echo "$0 ppa:user/ppa-name"
fi

54
build Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
build_name='fox-web-basic'
build_repos='mxfox.ru/chimera'
branch='latest'
while getopts "b:dph" opt; do
case $opt in
d) DRY=1;;
p) PUSH=1;;
b) branch="${OPTARG}";;
h) echo "Usage:
# -d - dry-run (only prepare, not build)
# -p - push (build, tag but no push.
# -b - branch
# -t - target
";exit;;
esac
done
if [ ! -f last_version ]
then
if [ ! -f init_version ]
then
echo "init_version not found!"
exit
fi
cp init_version last_version
fi
build_version=`cat last_version`
(( build_version++ ))
echo "Building image ${build_name}:$branch-$build_version";
if [ -n "$DRY" ]
then
echo DRY-RUN Selected. Build disabled
exit;
fi
push_suffix='--output=type=local,dest=./images'
if [ -n "$PUSH" ]
then
push_suffix='--push'
fi
(( build_version++ ))
docker buildx build --platform linux/arm,linux/arm64,linux/amd64 --tag=${build_repos}/${build_name}:${build_version} --tag ${build_repos}/${build_name}:latest . ${push_suffix}
echo ${build_version} > last_version

View File

@ -1,9 +0,0 @@
#!/bin/bash
build_version=`cat last_version`
(( build_version++ ))
echo $build_version;
docker build --tag=mxfox.ru/chimera/fox-web-basic:${build_version} .
docker tag mxfox.ru/chimera/fox-web-basic:${build_version} mxfox.ru/chimera/fox-web-basic:latest
echo ${build_version} > last_version

View File

@ -1 +1 @@
28 100050

View File

@ -1,2 +0,0 @@
deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main
# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu focal main

Binary file not shown.