diff --git a/.travis.yml b/.travis.yml index ce89e4bb..70ba9eb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ before_script: script: - composer ci - - if [[ ! -z "$DOCKERFILE_CHANGED" && "${TRAVIS_PHP_VERSION}" == "7.4" ]]; then docker build -t shlink-docker-image:temp . ; fi + - if [[ ! -z "${DOCKERFILE_CHANGED}" && "${TRAVIS_PHP_VERSION}" == "7.4" && "${TRAVIS_PULL_REQUEST}" != 'false' ]]; then docker build -t shlink-docker-image:temp . ; fi after_success: - rm -f build/clover.xml @@ -47,7 +47,7 @@ after_success: # Before deploying, build dist file for current travis tag before_deploy: - rm -f ocular.phar - - if [[ ! -z $TRAVIS_TAG && "${TRAVIS_PHP_VERSION}" == "7.4" ]]; then ./build.sh ${TRAVIS_TAG#?} ; fi + - if [[ ! -z ${TRAVIS_TAG} && "${TRAVIS_PHP_VERSION}" == "7.4" ]]; then ./build.sh ${TRAVIS_TAG#?} ; fi deploy: - provider: releases @@ -62,5 +62,5 @@ deploy: script: bash ./docker/build on: all_branches: true - condition: $TRAVIS_PULL_REQUEST == 'false' + condition: "${TRAVIS_PULL_REQUEST}" == 'false' php: '7.4' diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ede9184..64b529af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). +## [Unreleased] + +#### Added + +* [#709](https://github.com/shlinkio/shlink/issues/709) Added multi-architecture builds for the docker image. + +#### Changed + +* *Nothing* + +#### Deprecated + +* *Nothing* + +#### Removed + +* *Nothing* + +#### Fixed + +* *Nothing* + + ## 2.2.1 - 2020-05-11 #### Added diff --git a/Dockerfile b/Dockerfile index a1b1f6f1..75c4ae2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,6 +40,7 @@ RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS && \ docker-php-ext-enable swoole && \ apk del .phpize-deps + # Install shlink FROM base as builder COPY . . diff --git a/docker/README.md b/docker/README.md index e17e570e..199dc6e2 100644 --- a/docker/README.md +++ b/docker/README.md @@ -263,7 +263,13 @@ Once created just run shlink with the volume: docker run --name shlink -p 8080:8080 -v ${PWD}/my/config/dir:/etc/shlink/config/params shlinkio/shlink:stable ``` -## Multi instance considerations +## Multi-architecture + +Starting on v2.3.0, Shlink's docker image is built for multiple architectures. + +The only limitation is that images for architectures other than `amd64` will not have support for Microsoft SQL databases, since there are no official binaries. + +## Multi-instance considerations These are some considerations to take into account when running multiple instances of shlink. diff --git a/docker/build b/docker/build index 22580702..4cc7f56a 100755 --- a/docker/build +++ b/docker/build @@ -19,13 +19,13 @@ if [[ ! -z $TRAVIS_TAG ]]; then [[ $TRAVIS_TAG != *"alpha"* && $TRAVIS_TAG != *"beta"* ]] && TAGS="${TAGS} -t shlinkio/shlink:stable" docker buildx build --push \ - --build-arg SHLINK_VERSION=${TRAVIS_TAG#?} \ - --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ + --build-arg SHLINK_VERSION=${TRAVIS_TAG#?} \ + --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ ${TAGS} . # If build branch is develop, build latest (on master, when there's no tag, do not build anything) elif [[ "$TRAVIS_BRANCH" == 'develop' ]]; then docker buildx build --push \ - --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ - -t shlinkio/shlink:latest . + --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ + -t shlinkio/shlink:latest . fi