Merge pull request #770 from acelaya-forks/feature/multi-arch-improvements

Feature/multi arch improvements
This commit is contained in:
Alejandro Celaya 2020-05-16 11:35:56 +02:00 committed by GitHub
commit 9252cc269b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 8 deletions

View File

@ -35,7 +35,7 @@ before_script:
script: script:
- composer ci - 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: after_success:
- rm -f build/clover.xml - rm -f build/clover.xml
@ -47,7 +47,7 @@ after_success:
# Before deploying, build dist file for current travis tag # Before deploying, build dist file for current travis tag
before_deploy: before_deploy:
- rm -f ocular.phar - 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: deploy:
- provider: releases - provider: releases
@ -62,5 +62,5 @@ deploy:
script: bash ./docker/build script: bash ./docker/build
on: on:
all_branches: true all_branches: true
condition: $TRAVIS_PULL_REQUEST == 'false' condition: "${TRAVIS_PULL_REQUEST}" == 'false'
php: '7.4' php: '7.4'

View File

@ -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). 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 ## 2.2.1 - 2020-05-11
#### Added #### Added

View File

@ -40,6 +40,7 @@ RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS && \
docker-php-ext-enable swoole && \ docker-php-ext-enable swoole && \
apk del .phpize-deps apk del .phpize-deps
# Install shlink # Install shlink
FROM base as builder FROM base as builder
COPY . . COPY . .

View File

@ -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 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. These are some considerations to take into account when running multiple instances of shlink.

View File

@ -19,13 +19,13 @@ if [[ ! -z $TRAVIS_TAG ]]; then
[[ $TRAVIS_TAG != *"alpha"* && $TRAVIS_TAG != *"beta"* ]] && TAGS="${TAGS} -t shlinkio/shlink:stable" [[ $TRAVIS_TAG != *"alpha"* && $TRAVIS_TAG != *"beta"* ]] && TAGS="${TAGS} -t shlinkio/shlink:stable"
docker buildx build --push \ docker buildx build --push \
--build-arg SHLINK_VERSION=${TRAVIS_TAG#?} \ --build-arg SHLINK_VERSION=${TRAVIS_TAG#?} \
--platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
${TAGS} . ${TAGS} .
# If build branch is develop, build latest (on master, when there's no tag, do not build anything) # If build branch is develop, build latest (on master, when there's no tag, do not build anything)
elif [[ "$TRAVIS_BRANCH" == 'develop' ]]; then elif [[ "$TRAVIS_BRANCH" == 'develop' ]]; then
docker buildx build --push \ docker buildx build --push \
--platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
-t shlinkio/shlink:latest . -t shlinkio/shlink:latest .
fi fi