diff --git a/.github/scripts/docker-tags.sh b/.github/scripts/docker-tags.sh new file mode 100755 index 0000000..8c2a4e5 --- /dev/null +++ b/.github/scripts/docker-tags.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# Generates docker images tags for the docker/build-push-action@v2 action depending on the branch/tag. + +declare -a IMAGE_TAGS + +# feature/* => sha-xxxxxxx +# Note: disabled +#if [[ "${GITHUB_REF}" =~ "refs/heads/feature/" ]]; then +# GIT_SHA7=$(echo ${GITHUB_SHA} | cut -c1-7) # Short SHA (7 characters) +# IMAGE_TAGS+=("${IMAGE}:sha-${GIT_SHA7}-${VERSION}") +# IMAGE_TAGS+=("ghcr.io/${IMAGE}:sha-${GIT_SHA7}-${VERSION}") +#fi + +# develop => edge +if [[ "${GITHUB_REF}" == "refs/heads/develop" ]]; then + IMAGE_TAGS+=("${IMAGE}:edge-${VERSION}") + IMAGE_TAGS+=("ghcr.io/${IMAGE}:edge-${VERSION}") +fi + +# master => stable +if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then + IMAGE_TAGS+=("${IMAGE}:stable-${VERSION}") + IMAGE_TAGS+=("ghcr.io/${IMAGE}:stable-${VERSION}") +fi + +# tags/v1.0.0 => 1.0 +if [[ "${GITHUB_REF}" =~ "refs/tags/" ]]; then + # Extract version parts from release tag + IFS='.' read -a ver_arr <<< "${GITHUB_REF#refs/tags/}" + VERSION_MAJOR=${ver_arr[0]#v*} # 2.7.0 => "2" + VERSION_MINOR=${ver_arr[1]} # "2.7.0" => "7" + IMAGE_TAGS+=("${IMAGE}:stable-${VERSION}") + IMAGE_TAGS+=("${IMAGE}:${VERSION_MAJOR}-${VERSION}") + IMAGE_TAGS+=("${IMAGE}:${VERSION_MAJOR}.${VERSION_MINOR}-${VERSION}") + IMAGE_TAGS+=("ghcr.io/${IMAGE}:stable-${VERSION}") + IMAGE_TAGS+=("ghcr.io/${IMAGE}:${VERSION_MAJOR}-${VERSION}") + IMAGE_TAGS+=("ghcr.io/${IMAGE}:${VERSION_MAJOR}.${VERSION_MINOR}-${VERSION}") +fi + +# Output a comma concatenated list of image tags +IMAGE_TAGS_STR=$(IFS=,; echo "${IMAGE_TAGS[*]}") +echo "${IMAGE_TAGS_STR}" +echo "::set-output name=tags::${IMAGE_TAGS_STR}" diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml new file mode 100644 index 0000000..3844ecc --- /dev/null +++ b/.github/workflows/docker-build-push.yaml @@ -0,0 +1,157 @@ +# Build a Docker image and push it to GitHub Container Registry +# See https://github.com/docker/build-push-action/blob/master/.github/workflows/example.yml + +name: Docker Build and Push + +on: + schedule: + - cron: '0 10 * * 0' # everyday sunday at 10am + push: + branches: + - master + - develop + - feature/* + tags: + - 'v*.*.*' + +defaults: + run: + shell: bash + +jobs: + build-push: + name: Build and Push + runs-on: ubuntu-20.04 + strategy: + fail-fast: false # Don't cancel other jobs if one fails + matrix: + version: + - 10.2 + - 10.3 + - 10.4 + - 10.5 + env: + IMAGE: docksal/mariadb + UPSTREAM_IMAGE: mariadb + VERSION: ${{ matrix.version }} + steps: + - + name: Install prerequisites for tests + run: | + set -xeuo pipefail + sudo apt-get -qq update + # Install cgi-fcgi binary used in tests + sudo apt-get -y --no-install-recommends install libfcgi-bin + # Install bats for tests + git clone https://github.com/bats-core/bats-core.git + cd bats-core + sudo ./install.sh /usr/local + bats -v + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Check Docker + run: | + docker version + docker info + - + name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ secrets.GHCR_USERNAME }} + password: ${{ secrets.GHCR_TOKEN }} + - + # Calculates docker image tags for the given build context + # The output is used in build and push step as `tags: ${{ steps.docker_meta.outputs.tags }}` + # See https://github.com/crazy-max/ghaction-docker-meta + name: Docker meta + id: docker_meta + uses: crazy-max/ghaction-docker-meta@v1 + with: + # List of Docker images to use as base name for tags + images: | + ${{ env.IMAGE }} + ghcr.io/${{ env.IMAGE }} + tag-sha: true # add git short SHA as Docker tag + - + # Generate image meta information + name: Docker image tags + id: docker_tags + run: make tags + - + # Build for local use + registry cache (ghcr.io) + name: Build and cache image (local) + id: docker_build_local + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + build-args: | + UPSTREAM_IMAGE=${{ env.UPSTREAM_IMAGE }} + VERSION=${{ env.VERSION }} + #platforms: linux/amd64,linux/arm64 # Note: cannot use multi-platform with local image caching ("load: true") + tags: ${{ env.IMAGE }}:build-${{ env.VERSION }} + load: true # cache image locally for use by other steps + cache-from: type=registry,ref=ghcr.io/${{ env.DOCKER_IMAGE }}:build-${{ matrix.version }} + cache-to: type=inline # Write the cache metadata into the image configuration + - + # Print image info + name: Docker image info + run: | + set -xeuo pipefail + docker image ls | grep "${{ env.IMAGE }}" + docker image inspect "${{ env.IMAGE }}:build-${{ env.VERSION }}" + - + # Cache image layers in the registry + # This will pick-up the build cache from the local build step + name: Build and push image cache (ghcr.io) + id: docker_build_cache + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + build-args: | + UPSTREAM_IMAGE=${{ env.UPSTREAM_IMAGE }} + VERSION=${{ env.VERSION }} + platforms: linux/amd64,linux/arm64 + tags: ghcr.io/${{ env.IMAGE }}:build-${{ env.VERSION }} # Build cache tag in ghcr.io + push: ${{ github.event_name != 'pull_request' }} # Don't push for PRs + cache-to: type=inline # Write the cache metadata into the image configuration + - + # Run tests + name: Test + run: make test + - + # Push final image to the registry + # This will pick-up the build cache from the local build step + name: Build and push image + id: docker_build_push + # Don't run if the list of tags is empty + # Note: using tags from docker_tags (custom) + if: ${{ steps.docker_tags.outputs.tags != '' }} + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + build-args: | + UPSTREAM_IMAGE=${{ env.UPSTREAM_IMAGE }} + VERSION=${{ env.VERSION }} + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.docker_tags.outputs.tags }} # Note: using tags from docker_tags (custom script) + labels: ${{ steps.docker_meta.outputs.labels }} # Note: using lables from docker_meta + push: ${{ github.event_name != 'pull_request' }} # Don't push for PRs + cache-to: type=inline # Write the cache metadata into the image configuration diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8218371..0000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -dist: bionic - -language: minimal - -env: - global: - - REPO=docksal/mariadb - - LATEST_VERSION=10.3 - - matrix: - - VERSION=5.5 FROM=mariadb:5.5 - - VERSION=10.0 FROM=mariadb:10.0 - - VERSION=10.1 FROM=mariadb:10.1 - - VERSION=10.2 FROM=mariadb:10.2 - - VERSION=10.3 FROM=mariadb:10.3 - -install: - # Install Docksal to have a matching versions of Docker on the build host - - curl -fsSL https://get.docksal.io | bash - - fin version - - fin sysinfo - -script: - - make - - make test - -after_success: - - make release - -after_failure: - - make logs diff --git a/10.0/default.cnf b/10.0/default.cnf deleted file mode 100644 index 54ffc3b..0000000 --- a/10.0/default.cnf +++ /dev/null @@ -1,27 +0,0 @@ -[client] -default-character-set = utf8mb4 - -[mysql] -default-character-set = utf8mb4 - -[mysqld] -# Use multi-byte UTF (utf8mb4) encoding by default (supports emojis, Asian symbols, mathematical symbols, etc.) -character_set_server = utf8mb4 -collation_server = utf8mb4_unicode_ci -init_connect = 'SET NAMES utf8mb4' - -# Set innodb as default -default_storage_engine = InnoDB - -innodb_buffer_pool_size = 256M -innodb_log_buffer_size = 8M -innodb_log_file_size = 128MB - -innodb_file_per_table = 1 - -# See https://github.com/docksal/service-db/pull/1 -innodb_file_format = Barracuda -innodb_large_prefix = 1 - -# Max packets -max_allowed_packet = 128M diff --git a/10.0/mysql-variables.txt b/10.0/mysql-variables.txt deleted file mode 100644 index d92c076..0000000 --- a/10.0/mysql-variables.txt +++ /dev/null @@ -1,20 +0,0 @@ -character_set_client utf8mb4 -character_set_connection utf8mb4 -character_set_database utf8mb4 -character_set_filesystem binary -character_set_results utf8mb4 -character_set_server utf8mb4 -character_set_system utf8 -collation_connection utf8mb4_general_ci -collation_database utf8mb4_unicode_ci -collation_server utf8mb4_unicode_ci -default_storage_engine InnoDB -init_connect SET NAMES utf8mb4 -innodb_buffer_pool_size 268435456 -innodb_file_format Barracuda -innodb_file_per_table ON -innodb_flush_log_at_trx_commit 1 -innodb_large_prefix ON -innodb_log_buffer_size 8388608 -innodb_log_file_size 134217728 -max_allowed_packet 134217728 diff --git a/10.1/default.cnf b/10.1/default.cnf deleted file mode 100644 index 54ffc3b..0000000 --- a/10.1/default.cnf +++ /dev/null @@ -1,27 +0,0 @@ -[client] -default-character-set = utf8mb4 - -[mysql] -default-character-set = utf8mb4 - -[mysqld] -# Use multi-byte UTF (utf8mb4) encoding by default (supports emojis, Asian symbols, mathematical symbols, etc.) -character_set_server = utf8mb4 -collation_server = utf8mb4_unicode_ci -init_connect = 'SET NAMES utf8mb4' - -# Set innodb as default -default_storage_engine = InnoDB - -innodb_buffer_pool_size = 256M -innodb_log_buffer_size = 8M -innodb_log_file_size = 128MB - -innodb_file_per_table = 1 - -# See https://github.com/docksal/service-db/pull/1 -innodb_file_format = Barracuda -innodb_large_prefix = 1 - -# Max packets -max_allowed_packet = 128M diff --git a/10.2/default.cnf b/10.2/default.cnf index 54ffc3b..b403a1b 100644 --- a/10.2/default.cnf +++ b/10.2/default.cnf @@ -1,14 +1,11 @@ -[client] -default-character-set = utf8mb4 - -[mysql] -default-character-set = utf8mb4 - [mysqld] -# Use multi-byte UTF (utf8mb4) encoding by default (supports emojis, Asian symbols, mathematical symbols, etc.) -character_set_server = utf8mb4 -collation_server = utf8mb4_unicode_ci -init_connect = 'SET NAMES utf8mb4' +# Force utf8mb4 (multi-byte UTF) encoding (supports emojis, Asian symbols, mathematical symbols, etc.) +# Starting with mariadb 10.5, character-set-server and collation-server can only be set via command line arguments. +#character-set-server = utf8mb4 +#collation-server = utf8mb4_unicode_ci + +# Always use server character set settings +skip-character-set-client-handshake # Set innodb as default default_storage_engine = InnoDB @@ -19,9 +16,5 @@ innodb_log_file_size = 128MB innodb_file_per_table = 1 -# See https://github.com/docksal/service-db/pull/1 -innodb_file_format = Barracuda -innodb_large_prefix = 1 - # Max packets max_allowed_packet = 128M diff --git a/10.2/mysql-variables.txt b/10.2/mysql-variables.txt index d92c076..1604038 100644 --- a/10.2/mysql-variables.txt +++ b/10.2/mysql-variables.txt @@ -5,16 +5,13 @@ character_set_filesystem binary character_set_results utf8mb4 character_set_server utf8mb4 character_set_system utf8 -collation_connection utf8mb4_general_ci +collation_connection utf8mb4_unicode_ci collation_database utf8mb4_unicode_ci collation_server utf8mb4_unicode_ci default_storage_engine InnoDB -init_connect SET NAMES utf8mb4 innodb_buffer_pool_size 268435456 -innodb_file_format Barracuda innodb_file_per_table ON innodb_flush_log_at_trx_commit 1 -innodb_large_prefix ON innodb_log_buffer_size 8388608 innodb_log_file_size 134217728 max_allowed_packet 134217728 diff --git a/10.3/default.cnf b/10.3/default.cnf index ad4df5c..b403a1b 100644 --- a/10.3/default.cnf +++ b/10.3/default.cnf @@ -1,14 +1,11 @@ -[client] -default-character-set = utf8mb4 - -[mysql] -default-character-set = utf8mb4 - [mysqld] -# Use multi-byte UTF (utf8mb4) encoding by default (supports emojis, Asian symbols, mathematical symbols, etc.) -character_set_server = utf8mb4 -collation_server = utf8mb4_unicode_ci -init_connect = 'SET NAMES utf8mb4' +# Force utf8mb4 (multi-byte UTF) encoding (supports emojis, Asian symbols, mathematical symbols, etc.) +# Starting with mariadb 10.5, character-set-server and collation-server can only be set via command line arguments. +#character-set-server = utf8mb4 +#collation-server = utf8mb4_unicode_ci + +# Always use server character set settings +skip-character-set-client-handshake # Set innodb as default default_storage_engine = InnoDB @@ -19,9 +16,5 @@ innodb_log_file_size = 128MB innodb_file_per_table = 1 -# See https://github.com/docksal/service-db/pull/1 -#innodb_file_format = Barracuda -#innodb_large_prefix = 1 - # Max packets max_allowed_packet = 128M diff --git a/10.3/mysql-variables.txt b/10.3/mysql-variables.txt index 5785486..1604038 100644 --- a/10.3/mysql-variables.txt +++ b/10.3/mysql-variables.txt @@ -5,11 +5,10 @@ character_set_filesystem binary character_set_results utf8mb4 character_set_server utf8mb4 character_set_system utf8 -collation_connection utf8mb4_general_ci +collation_connection utf8mb4_unicode_ci collation_database utf8mb4_unicode_ci collation_server utf8mb4_unicode_ci default_storage_engine InnoDB -init_connect SET NAMES utf8mb4 innodb_buffer_pool_size 268435456 innodb_file_per_table ON innodb_flush_log_at_trx_commit 1 diff --git a/10.4/default.cnf b/10.4/default.cnf new file mode 100644 index 0000000..b403a1b --- /dev/null +++ b/10.4/default.cnf @@ -0,0 +1,20 @@ +[mysqld] +# Force utf8mb4 (multi-byte UTF) encoding (supports emojis, Asian symbols, mathematical symbols, etc.) +# Starting with mariadb 10.5, character-set-server and collation-server can only be set via command line arguments. +#character-set-server = utf8mb4 +#collation-server = utf8mb4_unicode_ci + +# Always use server character set settings +skip-character-set-client-handshake + +# Set innodb as default +default_storage_engine = InnoDB + +innodb_buffer_pool_size = 256M +innodb_log_buffer_size = 8M +innodb_log_file_size = 128MB + +innodb_file_per_table = 1 + +# Max packets +max_allowed_packet = 128M diff --git a/10.1/mysql-variables.txt b/10.4/mysql-variables.txt similarity index 80% rename from 10.1/mysql-variables.txt rename to 10.4/mysql-variables.txt index d92c076..1604038 100644 --- a/10.1/mysql-variables.txt +++ b/10.4/mysql-variables.txt @@ -5,16 +5,13 @@ character_set_filesystem binary character_set_results utf8mb4 character_set_server utf8mb4 character_set_system utf8 -collation_connection utf8mb4_general_ci +collation_connection utf8mb4_unicode_ci collation_database utf8mb4_unicode_ci collation_server utf8mb4_unicode_ci default_storage_engine InnoDB -init_connect SET NAMES utf8mb4 innodb_buffer_pool_size 268435456 -innodb_file_format Barracuda innodb_file_per_table ON innodb_flush_log_at_trx_commit 1 -innodb_large_prefix ON innodb_log_buffer_size 8388608 innodb_log_file_size 134217728 max_allowed_packet 134217728 diff --git a/10.5/default.cnf b/10.5/default.cnf new file mode 100644 index 0000000..2c66ed2 --- /dev/null +++ b/10.5/default.cnf @@ -0,0 +1,24 @@ +[mysqld] +# Force utf8mb4 (multi-byte UTF) encoding (supports emojis, Asian symbols, mathematical symbols, etc.) +# Starting with mariadb 10.5, character-set-server and collation-server can only be set via command line arguments. +#character-set-server = utf8mb4 +#collation-server = utf8mb4_unicode_ci + +# Always use server character set settings +skip-character-set-client-handshake + +# Set innodb as default +default_storage_engine = InnoDB + +innodb_buffer_pool_size = 256M +innodb_log_buffer_size = 8M +innodb_log_file_size = 128MB + +innodb_file_per_table = 1 + +# See https://github.com/docksal/service-db/pull/1 +#innodb_file_format = Barracuda +#innodb_large_prefix = 1 + +# Max packets +max_allowed_packet = 128M diff --git a/5.5/mysql-variables.txt b/10.5/mysql-variables.txt similarity index 80% rename from 5.5/mysql-variables.txt rename to 10.5/mysql-variables.txt index d92c076..1604038 100644 --- a/5.5/mysql-variables.txt +++ b/10.5/mysql-variables.txt @@ -5,16 +5,13 @@ character_set_filesystem binary character_set_results utf8mb4 character_set_server utf8mb4 character_set_system utf8 -collation_connection utf8mb4_general_ci +collation_connection utf8mb4_unicode_ci collation_database utf8mb4_unicode_ci collation_server utf8mb4_unicode_ci default_storage_engine InnoDB -init_connect SET NAMES utf8mb4 innodb_buffer_pool_size 268435456 -innodb_file_format Barracuda innodb_file_per_table ON innodb_flush_log_at_trx_commit 1 -innodb_large_prefix ON innodb_log_buffer_size 8388608 innodb_log_file_size 134217728 max_allowed_packet 134217728 diff --git a/5.5/default.cnf b/5.5/default.cnf deleted file mode 100644 index 54ffc3b..0000000 --- a/5.5/default.cnf +++ /dev/null @@ -1,27 +0,0 @@ -[client] -default-character-set = utf8mb4 - -[mysql] -default-character-set = utf8mb4 - -[mysqld] -# Use multi-byte UTF (utf8mb4) encoding by default (supports emojis, Asian symbols, mathematical symbols, etc.) -character_set_server = utf8mb4 -collation_server = utf8mb4_unicode_ci -init_connect = 'SET NAMES utf8mb4' - -# Set innodb as default -default_storage_engine = InnoDB - -innodb_buffer_pool_size = 256M -innodb_log_buffer_size = 8M -innodb_log_file_size = 128MB - -innodb_file_per_table = 1 - -# See https://github.com/docksal/service-db/pull/1 -innodb_file_format = Barracuda -innodb_large_prefix = 1 - -# Max packets -max_allowed_packet = 128M diff --git a/Dockerfile b/Dockerfile index 8462bc1..d682fe1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ -ARG FROM -FROM ${FROM} +ARG UPSTREAM_IMAGE +ARG VERSION +FROM ${UPSTREAM_IMAGE}:${VERSION} +# Has to be set again after FROM ARG VERSION # Docksal settings -COPY ${VERSION}/default.cnf /etc/mysql/conf.d/10-default.cnf +COPY ./${VERSION}/default.cnf /etc/mysql/conf.d/10-default.cnf VOLUME /var/lib/mysql @@ -21,7 +23,9 @@ RUN set -xe; \ rm -f /usr/local/bin/docker-preinit-entrypoint.patch /usr/local/bin/docker-postinit-entrypoint.patch EXPOSE 3306 -CMD ["mysqld"] + +# Starting with mariadb 10.5, character-set-server and collation-server can only be set via command line arguments. +CMD ["mysqld", "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci"] # Health check script HEALTHCHECK --interval=5s --timeout=1s --retries=12 CMD ["/opt/healthcheck.sh"] diff --git a/Makefile b/Makefile index 7afaf76..6898c5c 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,10 @@ -include env_make -FROM ?= mariadb:10.3 -VERSION ?= 10.3 -BUILD_TAG ?= $(VERSION) -SOFTWARE_VERSION ?= $(VERSION) +IMAGE ?= docksal/mariadb +UPSTREAM_IMAGE ?= mariadb +VERSION ?= 10.5 +BUILD_TAG ?= build-$(VERSION) -REPO ?= docksal/mariadb NAME = docksal-mariadb-$(VERSION) MYSQL_ROOT_PASSWORD = root @@ -20,22 +19,22 @@ ENV = -e MYSQL_ROOT_PASSWORD=$(MYSQL_ROOT_PASSWORD) -e MYSQL_USER=$(MYSQL_USER) .PHONY: build test push shell run start stop logs clean release build: - docker build -t $(REPO):$(BUILD_TAG) --build-arg FROM=$(FROM) --build-arg VERSION=$(VERSION) . + docker build -t $(IMAGE):$(BUILD_TAG) --build-arg UPSTREAM_IMAGE=$(UPSTREAM_IMAGE) --build-arg VERSION=$(VERSION) . test: - IMAGE=$(REPO):$(BUILD_TAG) NAME=$(NAME) VERSION=$(VERSION) ./tests/test.bats + IMAGE=$(IMAGE) BUILD_TAG=$(BUILD_TAG) NAME=$(NAME) VERSION=$(VERSION) ./tests/test.bats push: - docker push $(REPO):$(BUILD_TAG) + docker push $(IMAGE):$(BUILD_TAG) shell: clean - docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(BUILD_TAG) /bin/bash + docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(IMAGE):$(BUILD_TAG) /bin/bash run: clean - docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(BUILD_TAG) + docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) $(IMAGE):$(BUILD_TAG) start: clean - docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(REPO):$(BUILD_TAG) + docker run -d --name $(NAME) $(PORTS) $(VOLUMES) $(ENV) $(IMAGE):$(BUILD_TAG) exec: docker exec $(NAME) /bin/bash -c "$(CMD)" @@ -53,7 +52,7 @@ logs: clean: docker rm -f $(NAME) >/dev/null 2>&1 || true -release: - @scripts/docker-push.sh +tags: + @.github/scripts/docker-tags.sh default: build diff --git a/README.md b/README.md index db2df3a..cad0606 100644 --- a/README.md +++ b/README.md @@ -8,17 +8,17 @@ This image(s) is part of the [Docksal](http://docksal.io) image library. ## Features -- Better default settings (see `default.cnf`) +- Better default settings (see `/default.cnf`) - Ability to pass additional settings via a file mounted into the container - User defined MySQL settings are expected in `/var/www/.docksal/etc/mysql/my.cnf` in the container. - Running a startup script as root - Scripts should be placed in the `/docker-entrypoint.d/` folder - Docker heathcheck support +- Supported architectures: linux/amd64,linux/arm64 ## Versions -- `docksal/mariadb:5.5` -- `docksal/mariadb:10.0` -- `docksal/mariadb:10.1` - `docksal/mariadb:10.2` -- `docksal/mariadb:10.3`, `docksal/mariadb:latest` +- `docksal/mariadb:10.3` +- `docksal/mariadb:10.4` +- `docksal/mariadb:10.5`, `docksal/mariadb:latest` diff --git a/scripts/docker-push.sh b/scripts/docker-push.sh deleted file mode 100755 index 62be9d1..0000000 --- a/scripts/docker-push.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash - -# ----- Helper functions ----- # - -is_edge () -{ - [[ "${TRAVIS_BRANCH}" == "develop" ]] -} - -is_stable () -{ - [[ "${TRAVIS_BRANCH}" == "master" ]] -} - -is_release () -{ - [[ "${TRAVIS_TAG}" != "" ]] -} - -# Check whether the current build is for a pull request -is_pr () -{ - [[ "${TRAVIS_PULL_REQUEST}" != "false" ]] -} - -is_latest () -{ - [[ "${VERSION}" == "${LATEST_VERSION}" ]] -} - -# Tag and push an image -# $1 - source image -# $2 - target image -tag_and_push () -{ - local source=$1 - local target=$2 - - # Base image - echo "Pushing ${target} image ..." - docker tag ${source} ${target} - docker push ${target} -} - -# ---------------------------- # - -# Extract version parts from release tag -IFS='.' read -a ver_arr <<< "$TRAVIS_TAG" -VERSION_MAJOR=${ver_arr[0]#v*} # 2.7.0 => "2" -VERSION_MINOR=${ver_arr[1]} # "2.7.0" => "7" - -# Possible docker image tags -# "image:tag" pattern: :[-][-] -IMAGE_TAG_EDGE="${SOFTWARE_VERSION}-edge" -IMAGE_TAG_STABLE="${SOFTWARE_VERSION}" -IMAGE_TAG_RELEASE_MAJOR="${SOFTWARE_VERSION}-${VERSION_MAJOR}" -IMAGE_TAG_RELEASE_MAJOR_MINOR="${SOFTWARE_VERSION}-${VERSION_MAJOR}.${VERSION_MINOR}" -IMAGE_TAG_LATEST="latest" - -# Skip pull request builds -is_pr && exit - -docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}" - -# Push images -if is_edge; then - tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_EDGE} -elif is_stable; then - tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_STABLE} -elif is_release; then - # Have stable, major, minor tags match - tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_STABLE} - tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_RELEASE_MAJOR} - tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_RELEASE_MAJOR_MINOR} -else - # Exit if not on develop, master or release tag - exit -fi - -# Special case for the "latest" tag -# Push (base image only) on stable and release builds -if is_latest && (is_stable || is_release); then - tag_and_push ${REPO}:${BUILD_TAG} ${REPO}:${IMAGE_TAG_LATEST} -fi