From b601bd365f7a58edbf6c29f7c82f3800774374f4 Mon Sep 17 00:00:00 2001 From: "Pavel@Vostro5468" Date: Fri, 31 Dec 2021 13:45:07 +0300 Subject: [PATCH] Updated for build ARM --- .gitignore | 1 + Dockerfile | 21 +++++++++++++- Dockerfile.debian | 17 ----------- apt-add-repos | 24 ---------------- build | 54 +++++++++++++++++++++++++++++++++++ build.sh | 9 ------ last_version | 2 +- ondrej-ubuntu-php-focal.list | 2 -- ondrej_ubuntu_php.gpg | Bin 360 -> 0 bytes 9 files changed, 76 insertions(+), 54 deletions(-) create mode 100644 .gitignore delete mode 100644 Dockerfile.debian delete mode 100755 apt-add-repos create mode 100755 build delete mode 100755 build.sh delete mode 100644 ondrej-ubuntu-php-focal.list delete mode 100644 ondrej_ubuntu_php.gpg diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..187d362 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/images diff --git a/Dockerfile b/Dockerfile index 3c4cde5..4e64d83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,30 @@ FROM ubuntu:18.04 +ENV php_version=7.4 + COPY ["timezone", "localtime", "/etc/"] RUN apt update -y \ && apt-get install gnupg gnupg1 gnupg2 software-properties-common -y \ && apt-add-repository ppa:ondrej/php \ && 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 autoremove -y \ && rm -rf /var/lib/apt/lists/* \ @@ -15,6 +33,7 @@ RUN apt update -y \ COPY docker-entrypoint.sh / COPY 000-default.conf /etc/apache2/sites-available +WORKDIR /var/www/hmtl EXPOSE 80 CMD ["/docker-entrypoint.sh"] diff --git a/Dockerfile.debian b/Dockerfile.debian deleted file mode 100644 index 80660c1..0000000 --- a/Dockerfile.debian +++ /dev/null @@ -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"] - - - diff --git a/apt-add-repos b/apt-add-repos deleted file mode 100755 index 2222a3c..0000000 --- a/apt-add-repos +++ /dev/null @@ -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 - diff --git a/build b/build new file mode 100755 index 0000000..8504bca --- /dev/null +++ b/build @@ -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 + diff --git a/build.sh b/build.sh deleted file mode 100755 index e2f028b..0000000 --- a/build.sh +++ /dev/null @@ -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 \ No newline at end of file diff --git a/last_version b/last_version index 9902f17..b047711 100644 --- a/last_version +++ b/last_version @@ -1 +1 @@ -28 +100050 diff --git a/ondrej-ubuntu-php-focal.list b/ondrej-ubuntu-php-focal.list deleted file mode 100644 index a5b9191..0000000 --- a/ondrej-ubuntu-php-focal.list +++ /dev/null @@ -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 diff --git a/ondrej_ubuntu_php.gpg b/ondrej_ubuntu_php.gpg deleted file mode 100644 index 82ef42b08cd94b2944e73af8c16fad296ad9a8a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 360 zcmV-u0hj)mjRZ-3`J4d+0J4J#K-FIPmiB*>|Lw-qIn$%n}5`Po1Hf*FNak#Awd|4UVGNDlnmns{I%0={+EnmwAK-9N=MgOdZaJMeU`N6ls? zm-dLl=KY)D^VV#b{j4GeZUGpY9*-r)gwihAieAGv7Q$7Q>oR)*-vAK-00FcgOks6y zV`y+;WFSybK_F&tav)D`WW||fY9Lc}a>KodwgeLa0stTd0!e-OoB|sI1`7!Y2Ll2G z6#@tY1Qr4V0RkQY0vCV)3JDNTPN1sgCVFf_HUs`OwKh@(0#y1E@pi@aTapnGiZ4uR znA%drtfPg?2uYcAL6_%&kkeZ)UV7rc3Elolp(^~b3aE`NHa~Rcitxg}{jkXDYMm-! zyj`>QzQ=6F7@ssRh9C2=XfyAhRPtaRx!z1NuHc3iF((SQnN7r0yJ`VLDkV7(<@gze G;5f_TDWV?$