From c556d8123bf6b628f45427fbfa326de1735a3d0f Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 21 Mar 2020 15:43:52 +0100 Subject: [PATCH 1/2] Fixed name of the build arg passed when building docker for a specific tag --- docker/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/build b/docker/build index a02bd4e1..5eea7888 100755 --- a/docker/build +++ b/docker/build @@ -5,7 +5,7 @@ echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin # If there is a tag, regardless the branch, build that docker tag and also "stable" if [[ ! -z $TRAVIS_TAG ]]; then - docker build --build-arg VERSION=${TRAVIS_TAG#?} -t shlinkio/shlink:${TRAVIS_TAG#?} -t shlinkio/shlink:stable . + docker build --build-arg SHLINK_VERSION=${TRAVIS_TAG#?} -t shlinkio/shlink:${TRAVIS_TAG#?} -t shlinkio/shlink:stable . docker push shlinkio/shlink:${TRAVIS_TAG#?} docker push shlinkio/shlink:stable # If build branch is develop, build latest (on master, when there's no tag, do not build anything) From d22f020eb53eaa21d4c78aad73a9d7f09373157b Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 21 Mar 2020 16:11:56 +0100 Subject: [PATCH 2/2] Ensured more non-prod files are ignored/deleted from the final docker image --- .dockerignore | 9 +++++---- Dockerfile | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index 7c730c69..4559d3e2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,17 +8,18 @@ data/migrations_template.txt data/GeoLite2-City.* data/database.sqlite data/shlink-tests.db -**/.gitignore CHANGELOG.md +UPGRADE.md composer.lock vendor docs indocker docker-* php* +.php* infection.json -phpstan.neon **/test* build* -.github -hooks +.git* +.scrutinizer.yml +.travis.yml diff --git a/Dockerfile b/Dockerfile index 96733933..1eb2715b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,8 @@ FROM base as builder COPY . . COPY --from=composer:1.10.1 /usr/bin/composer ./composer.phar RUN php composer.phar install --no-dev --optimize-autoloader --prefer-dist --no-progress --no-interaction && \ + php composer.phar clear-cache && \ + rm composer.* && \ sed -i "s/%SHLINK_VERSION%/${SHLINK_VERSION}/g" config/autoload/app_options.global.php