Replaced MariaDB library to MySQL 8

This commit is contained in:
Alexey Pustovalov 2020-09-07 20:37:26 -04:00
commit d89235748a
5 changed files with 228 additions and 2 deletions

220
.github/workflows/CI.yml vendored Normal file
View File

@ -0,0 +1,220 @@
name: CI
on:
release:
types:
- published
push:
branches:
- 3.0
- 4.0
- 5.0
- trunk
paths-ignore:
- '.env*'
- 'docker-compose*.yaml'
- '*/rhel/*'
- "**.md"
defaults:
run:
shell: bash
jobs:
build:
env:
LATEST_BRANCH: "${{ github.event.repository.master_branch }}"
DOCKER_REPOSITORY: "zabbix"
strategy:
fail-fast: false
matrix:
build:
- agent
- agent2
- java-gateway
- proxy-mysql
- proxy-sqlite3
- server-mysql
- server-pgsql
- snmptraps
- web-apache-mysql
- web-apache-pgsql
- web-nginx-mysql
- web-nginx-pgsql
os:
- alpine
- ubuntu
- centos
exclude:
- os: centos
build: agent2
- os: ubuntu
build: agent2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install buildx
env:
DOCKER_CLI_EXPERIMENTAL: enabled
run: |
BUILDX_VERSION="0.4.2"
QEMU_TAG="latest"
mkdir -p ~/.docker/cli-plugins/
curl -L https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64 \
-o ~/.docker/cli-plugins/docker-buildx
chmod +x ~/.docker/cli-plugins/docker-buildx
docker pull -q multiarch/qemu-user-static:latest
docker run --rm --privileged multiarch/qemu-user-static:${QEMU_TAG} --reset -p yes --credential yes
docker buildx create --name builder-${GITHUB_SHA::8} --driver docker-container --use
docker buildx inspect --bootstrap
docker info
docker buildx inspect
- name: Available platforms
run: docker buildx inspect | grep Platforms
- name: Prepare platform list
id: platform
run: |
DOCKER_PLATFORM="linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/s390x,linux/ppc64le"
if [ "${{ matrix.os }}" == "ubuntu" ]; then
DOCKER_PLATFORM="linux/amd64,linux/arm/v7,linux/arm64,linux/s390x,linux/ppc64le"
fi
if [ "${{ matrix.os }}" == "ubuntu" ] && [ "${{ matrix.build }}" == "snmptraps" ]; then
DOCKER_PLATFORM="linux/amd64,linux/arm64"
fi
if [ "${{ matrix.os }}" == "centos" ]; then
#DOCKER_PLATFORM="linux/amd64,linux/arm64,linux/ppc64le"
DOCKER_PLATFORM="linux/amd64"
fi
if [ "${{ matrix.build }}" == "java-gateway" ]; then
DOCKER_PLATFORM=${DOCKER_PLATFORM%",linux/ppc64le"}
fi
echo ::set-output name=list::${DOCKER_PLATFORM}
- name: Prepare environment (push)
if: github.event_name == 'push'
id: prepare_push
run: |
TAGS_ARRAY=()
IMAGE_NAME="${{ env.DOCKER_REPOSITORY }}/zabbix-${{ matrix.build }}"
GIT_BRANCH="${{ github.ref }}"
GIT_BRANCH=${GIT_BRANCH:11}
echo "::warning Branch - ${GIT_BRANCH}"
TAGS_ARRAY+=("$IMAGE_NAME:${{ matrix.os }}-${GIT_BRANCH}")
if [ "${{ matrix.os }}" == "alpine" ] && [ "${LATEST_BRANCH}" == "${GIT_BRANCH}" ]; then
TAGS_ARRAY+=("$IMAGE_NAME:latest")
fi
if [ "${LATEST_BRANCH}" == "${GIT_BRANCH}" ]; then
TAGS_ARRAY+=("$IMAGE_NAME:${{ matrix.os }}-latest")
fi
TAGS=$(printf -- "--tag %s " "${TAGS_ARRAY[@]}")
echo "::warning Tags - ${TAGS}"
echo ::set-output name=image_name::${IMAGE_NAME}
echo ::set-output name=image_tag_versions::$(printf -- "|%s" "${TAGS_ARRAY[@]}")
echo ::set-output name=buildx_args::--platform "${{ steps.platform.outputs.list }}" \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg VCS_REF=${GITHUB_SHA::8} \
${TAGS} \
--file ./${{ matrix.build }}/${{ matrix.os }}/Dockerfile ./${{ matrix.build }}/${{ matrix.os }}
- name: Prepare environment (release)
if: github.event_name == 'release' && github.event.action == 'created'
id: prepare_release
run: |
TAGS_ARRAY=()
IMAGE_NAME="${{ env.DOCKER_REPOSITORY }}/zabbix-${{ matrix.build }}"
RELEASE_VERSION="${{ github.ref }}"
RELEASE_VERSION=${RELEASE_VERSION:10}
GIT_BRANCH=${RELEASE_VERSION%.*}
echo "::warning Release version ${RELEASE_VERSION}. Branch ${GIT_BRANCH}"
TAGS_ARRAY+=("$IMAGE_NAME:${{ matrix.os }}-${RELEASE_VERSION}")
if [ "${{ matrix.os }}" == "alpine" ] && [ "${LATEST_BRANCH}" == "${GIT_BRANCH}" ]; then
TAGS_ARRAY+=("$IMAGE_NAME:latest")
fi
TAGS=$(printf -- "--tag %s " "${TAGS_ARRAY[@]}")
echo ::set-output name=image_name::${IMAGE_NAME}
echo ::set-output name=image_tag_versions::$(printf -- "|%s" "${TAGS_ARRAY[@]}")
echo ::set-output name=buildx_args::--platform "${{ steps.platform.outputs.list }}" \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg VCS_REF=${GITHUB_SHA::8} \
$TAGS \
--file ./${{ matrix.build }}/${{ matrix.os }}/Dockerfile ./${{ matrix.build }}/${{ matrix.os }}
- name: Build images
env:
DOCKER_CLI_EXPERIMENTAL: enabled
run: |
if [ ! -z "${{ steps.prepare_push.outputs.buildx_args }}" ]; then
BUILDX_ARGS="${{ steps.prepare_push.outputs.buildx_args }}"
elif [ ! -z "${{ steps.prepare_release.outputs.buildx_args }}" ]; then
BUILDX_ARGS="${{ steps.prepare_release.outputs.buildx_args }}"
fi
docker buildx build --cache-to "type=local,dest=/tmp/.buildx-cache" \
--output "type=image,push=false" \
${BUILDX_ARGS}
- name: Docker Hub login
if: success()
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push images from cache
if: success()
env:
DOCKER_CLI_EXPERIMENTAL: enabled
run: |
if [ ! -z "${{ steps.prepare_push.outputs.buildx_args }}" ]; then
BUILDX_ARGS="${{ steps.prepare_push.outputs.buildx_args }}"
elif [ ! -z "${{ steps.prepare_release.outputs.buildx_args }}" ]; then
BUILDX_ARGS="${{ steps.prepare_release.outputs.buildx_args }}"
fi
docker buildx build --cache-from "type=local,src=/tmp/.buildx-cache" \
--output "type=image,push=false" \
${BUILDX_ARGS}
- name: Inspect images
run: |
echo "::warning push - ${{ steps.prepare_push.outputs.buildx_args }}"
echo "::warning release - ${{ steps.prepare_release.outputs.buildx_args }}"
if [ ! -z "${{ steps.prepare_push.outputs.image_tag_versions }}" ]; then
IMAGE_TAG_VERSIONS="${{ steps.prepare_push.outputs.image_tag_versions }}"
echo "::warning tags push raw - $IMAGE_TAG_VERSIONS"
elif [ ! -z "${{ steps.prepare_release.outputs.image_tag_versions }}" ]; then
IMAGE_TAG_VERSIONS="${{ steps.prepare_release.outputs.image_tag_versions }}"
echo "::warning tags release raw - $IMAGE_TAG_VERSIONS"
fi
IMAGE_TAG_VERSIONS=${IMAGE_TAG_VERSIONS%%+(|)}
IFS='|' read -r -a IMAGE_TAG_VERSIONS <<< $IMAGE_TAG_VERSIONS
for version in ${IMAGE_TAG_VERSIONS[@]}; do
echo "Checking \"$version\"... "
docker buildx imagetools inspect $version
done

View File

@ -31,11 +31,12 @@ RUN set -eux && \
mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p /usr/share/doc/zabbix-proxy-mysql && \ mkdir -p /usr/share/doc/zabbix-proxy-mysql && \
dnf --quiet makecache && \ dnf --quiet makecache && \
dnf -y install http://repo.zabbix.com/non-supported/rhel/8/x86_64/fping-3.16-1.el8.x86_64.rpm --setopt=tsflags=nodocs && \ dnf -y install epel-release && \
dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \ dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \
libcurl-minimal \ libcurl-minimal \
libevent \ libevent \
libssh \ libssh \
fping \
libxml2 \ libxml2 \
mariadb \ mariadb \
net-snmp-libs \ net-snmp-libs \

View File

@ -31,11 +31,13 @@ RUN set -eux && \
mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p /usr/share/doc/zabbix-proxy-sqlite3 && \ mkdir -p /usr/share/doc/zabbix-proxy-sqlite3 && \
dnf --quiet makecache && \ dnf --quiet makecache && \
dnf -y install epel-release && \
dnf -y install http://repo.zabbix.com/non-supported/rhel/8/x86_64/fping-3.16-1.el8.x86_64.rpm --setopt=tsflags=nodocs && \ dnf -y install http://repo.zabbix.com/non-supported/rhel/8/x86_64/fping-3.16-1.el8.x86_64.rpm --setopt=tsflags=nodocs && \
dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \ dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \
libcurl-minimal \ libcurl-minimal \
libevent \ libevent \
libssh \ libssh \
fping \
libxml2 \ libxml2 \
net-snmp-libs \ net-snmp-libs \
OpenIPMI-libs \ OpenIPMI-libs \

View File

@ -33,8 +33,10 @@ RUN set -eux && \
mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p /usr/share/doc/zabbix-server-mysql && \ mkdir -p /usr/share/doc/zabbix-server-mysql && \
dnf --quiet makecache && \ dnf --quiet makecache && \
dnf -y install epel-release && \
dnf -y install --setopt=tsflags=nodocs http://repo.zabbix.com/non-supported/rhel/8/x86_64/fping-3.16-1.el8.x86_64.rpm && \ dnf -y install --setopt=tsflags=nodocs http://repo.zabbix.com/non-supported/rhel/8/x86_64/fping-3.16-1.el8.x86_64.rpm && \
dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \ dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \
fping \
tzdata \ tzdata \
iputils \ iputils \
traceroute \ traceroute \

View File

@ -33,8 +33,9 @@ RUN set -eux && \
mkdir -p /usr/lib/zabbix/externalscripts && \ mkdir -p /usr/lib/zabbix/externalscripts && \
mkdir -p /usr/share/doc/zabbix-server-postgresql && \ mkdir -p /usr/share/doc/zabbix-server-postgresql && \
dnf --quiet makecache && \ dnf --quiet makecache && \
dnf -y install --setopt=tsflags=nodocs https://repo.zabbix.com/non-supported/rhel/8/x86_64/fping-3.16-1.el8.x86_64.rpm && \ dnf -y install epel-release && \
dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \ dnf -y install --setopt=tsflags=nodocs --setopt=install_weak_deps=False --best \
fping \
iputils \ iputils \
tzdata \ tzdata \
traceroute \ traceroute \