Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
Pavel Dmitriev | 072e214484 | |
Pavel Dmitriev | 0a3016ad5b | |
Pavel Dmitriev | 13281c7c9a | |
Pavel Dmitriev | fda9bbf346 | |
Pavel@Vostro5468 | 1448a3a2dd | |
Pavel@Vostro5468 | 03f7bc78d0 |
|
@ -0,0 +1,47 @@
|
||||||
|
version: v0
|
||||||
|
runs:
|
||||||
|
- name: Build image
|
||||||
|
docker_registries_auth:
|
||||||
|
'mxfox.ru':
|
||||||
|
username:
|
||||||
|
from_variable: mxfoxDockerLogin
|
||||||
|
password:
|
||||||
|
from_variable: mxfoxDockerSecret
|
||||||
|
tasks:
|
||||||
|
- name: build docker image
|
||||||
|
runtime:
|
||||||
|
containers:
|
||||||
|
- image: mxfox.ru/mxfox/docker-dind.buildx:latest
|
||||||
|
privileged: true
|
||||||
|
#shell: /busybox/sh
|
||||||
|
working_dir: /workspace
|
||||||
|
environment:
|
||||||
|
DOCKERLOGIN:
|
||||||
|
from_variable: mxfoxDockerLogin
|
||||||
|
DOCKERPASS:
|
||||||
|
from_variable: mxfoxDockerSecret
|
||||||
|
steps:
|
||||||
|
- clone:
|
||||||
|
- run:
|
||||||
|
name: buildX prepare
|
||||||
|
command: buildx-bgstart.sh
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: buildX build
|
||||||
|
command: |
|
||||||
|
case ${AGOLA_GIT_BRANCH} in
|
||||||
|
master)
|
||||||
|
export xBuildSuffix=" -t mxfox.ru/mxfox/fox-web-basic:master-${AGOLA_GIT_COMMITSHA:0:10} -t mxfox.ru/mxfox/fox-web-basic:latest --push"
|
||||||
|
;;
|
||||||
|
test)
|
||||||
|
export xBuildSuffix=" -t mxfox.ru/mxfox/fox-web-basic:test-${AGOLA_GIT_COMMITSHA:0:10} -t mxfox.ru/mxfox/fox-web-basic:test --push"
|
||||||
|
;;
|
||||||
|
php7.4)
|
||||||
|
export xBuildSuffix=" -t mxfox.ru/mxfox/fox-web-basic:php-7.4-${AGOLA_GIT_COMMITSHA:0:10} -t mxfox.ru/mxfox/fox-web-basic:php-7.4 --push"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
export xBuildSuffix=""
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
docker login mxfox.ru -u ${DOCKERLOGIN} -p ${DOCKERPASS}
|
||||||
|
docker buildx build --platform linux/amd64,linux/arm64,linux/arm . ${xBuildSuffix}
|
|
@ -1,6 +1,7 @@
|
||||||
FROM ubuntu:20.04
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
ENV php_version=7.4
|
ENV php_version=8.1
|
||||||
|
ENV FOX_WEBROOT=/var/www/html
|
||||||
|
|
||||||
COPY ["/rootfs/etc/timezone", "/rootfs/etc/localtime", "/etc/"]
|
COPY ["/rootfs/etc/timezone", "/rootfs/etc/localtime", "/etc/"]
|
||||||
|
|
||||||
|
@ -24,12 +25,14 @@ RUN apt-get update -y \
|
||||||
php${php_version}-msgpack \
|
php${php_version}-msgpack \
|
||||||
php${php_version}-oauth \
|
php${php_version}-oauth \
|
||||||
php${php_version}-zip \
|
php${php_version}-zip \
|
||||||
|
php${php_version}-sqlite3 \
|
||||||
cron \
|
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/* \
|
||||||
&& rm -rf /var/www/html/* \
|
&& rm -rf /var/www/html/* \
|
||||||
&& a2enmod rewrite
|
&& a2enmod rewrite \
|
||||||
|
&& sed -i -e 's/^ErrorLog.*$/ErrorLog \/dev\/stdout/g' /etc/apache2/apache2.conf
|
||||||
|
|
||||||
COPY rootfs /
|
COPY rootfs /
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
54
build
54
build
|
@ -1,54 +0,0 @@
|
||||||
#!/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 "1000" > init_version
|
|
||||||
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
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
echo -n "Copying FOX ENV...";
|
||||||
|
env | grep -E "^FOX_" > /etc/security/pam_env.conf
|
||||||
|
echo "OK"
|
||||||
|
|
||||||
find /etc/fox-start.d -maxdepth 1 -type f -exec {} \;
|
find /etc/fox-start.d -maxdepth 1 -type f -exec {} \;
|
||||||
echo "Starting cron:"
|
echo "Starting cron:"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
# modules, e.g.
|
# modules, e.g.
|
||||||
#LogLevel info ssl:warn
|
#LogLevel info ssl:warn
|
||||||
|
|
||||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
#ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||||
|
|
||||||
# For most configuration files from conf-available/, which are
|
# For most configuration files from conf-available/, which are
|
||||||
|
|
Loading…
Reference in New Issue