From 49f8b84374539e7df3d6176fcad6623dced66783 Mon Sep 17 00:00:00 2001 From: Magnus Walbeck Date: Tue, 6 Jul 2021 16:11:23 +0200 Subject: [PATCH 1/2] Switch to building docker containers with buildx and build arm64 version, fixes #84 --- .drone.star | 6 ++++-- .drone.yml | 24 ++++++++++++++++-------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.drone.star b/.drone.star index 3d29ab6..fe5c150 100644 --- a/.drone.star +++ b/.drone.star @@ -69,11 +69,12 @@ def default_tests(name, grav_version, dockerfile="Dockerfile"): "steps": [ { "name": "build test", - "image": "plugins/docker", + "image": "thegeeklab/drone-docker-buildx", "pull": "if-not-exists", "settings": { "dockerfile": "%s/%s" % (grav_version, dockerfile), "dry_run": "true", + "platforms": "linux/amd64,linux/arm64", "repo": "mwalbeck/getgrav" }, } @@ -109,7 +110,7 @@ def release(name, grav_version, dockerfile="Dockerfile", app_env="", custom_tags }, { "name": "build and publish", - "image": "plugins/docker", + "image": "thegeeklab/drone-docker-buildx", "pull": "if-not-exists", "settings": { "dockerfile": "%s/%s" % (grav_version, dockerfile), @@ -119,6 +120,7 @@ def release(name, grav_version, dockerfile="Dockerfile", app_env="", custom_tags "password": { "from_secret": "dockerhub_password" }, + "platforms": "linux/amd64,linux/arm64", "repo": "mwalbeck/getgrav" }, }, diff --git a/.drone.yml b/.drone.yml index 0a905d5..92c210f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -50,10 +50,11 @@ platform: steps: - name: build test pull: if-not-exists - image: plugins/docker + image: thegeeklab/drone-docker-buildx settings: dockerfile: 1.6/Dockerfile dry_run: true + platforms: linux/amd64,linux/arm64 repo: mwalbeck/getgrav trigger: @@ -75,10 +76,11 @@ platform: steps: - name: build test pull: if-not-exists - image: plugins/docker + image: thegeeklab/drone-docker-buildx settings: dockerfile: 1.6/Dockerfile.prod dry_run: true + platforms: linux/amd64,linux/arm64 repo: mwalbeck/getgrav trigger: @@ -100,10 +102,11 @@ platform: steps: - name: build test pull: if-not-exists - image: plugins/docker + image: thegeeklab/drone-docker-buildx settings: dockerfile: 1.7/Dockerfile dry_run: true + platforms: linux/amd64,linux/arm64 repo: mwalbeck/getgrav trigger: @@ -125,10 +128,11 @@ platform: steps: - name: build test pull: if-not-exists - image: plugins/docker + image: thegeeklab/drone-docker-buildx settings: dockerfile: 1.7/Dockerfile.prod dry_run: true + platforms: linux/amd64,linux/arm64 repo: mwalbeck/getgrav trigger: @@ -159,11 +163,12 @@ steps: - name: build and publish pull: if-not-exists - image: plugins/docker + image: thegeeklab/drone-docker-buildx settings: dockerfile: 1.6/Dockerfile password: from_secret: dockerhub_password + platforms: linux/amd64,linux/arm64 repo: mwalbeck/getgrav username: from_secret: dockerhub_username @@ -215,11 +220,12 @@ steps: - name: build and publish pull: if-not-exists - image: plugins/docker + image: thegeeklab/drone-docker-buildx settings: dockerfile: 1.6/Dockerfile.prod password: from_secret: dockerhub_password + platforms: linux/amd64,linux/arm64 repo: mwalbeck/getgrav username: from_secret: dockerhub_username @@ -271,11 +277,12 @@ steps: - name: build and publish pull: if-not-exists - image: plugins/docker + image: thegeeklab/drone-docker-buildx settings: dockerfile: 1.7/Dockerfile password: from_secret: dockerhub_password + platforms: linux/amd64,linux/arm64 repo: mwalbeck/getgrav username: from_secret: dockerhub_username @@ -328,11 +335,12 @@ steps: - name: build and publish pull: if-not-exists - image: plugins/docker + image: thegeeklab/drone-docker-buildx settings: dockerfile: 1.7/Dockerfile.prod password: from_secret: dockerhub_password + platforms: linux/amd64,linux/arm64 repo: mwalbeck/getgrav username: from_secret: dockerhub_username -- 2.45.2 From b2580c0b1cf43010f6d1221fbb78bab97923defc Mon Sep 17 00:00:00 2001 From: Magnus Walbeck Date: Wed, 7 Jul 2021 00:20:48 +0200 Subject: [PATCH 2/2] Deprecate grav 1.6 --- .drone.star | 4 -- .drone.yml | 165 -------------------------------------------- 1.6/Dockerfile | 84 ---------------------- 1.6/Dockerfile.prod | 85 ----------------------- README.md | 2 - 5 files changed, 340 deletions(-) delete mode 100644 1.6/Dockerfile delete mode 100644 1.6/Dockerfile.prod diff --git a/.drone.star b/.drone.star index fe5c150..4929b19 100644 --- a/.drone.star +++ b/.drone.star @@ -1,12 +1,8 @@ def main(ctx): return [ lint(), - default_tests("1.6", "1.6"), - default_tests("1.6-prod", "1.6", "Dockerfile.prod"), default_tests("1.7", "1.7"), default_tests("1.7-prod", "1.7", "Dockerfile.prod"), - release("1.6", "1.6"), - release("1.6-prod", "1.6", "Dockerfile.prod", "prod"), release("1.7", "1.7", custom_tags="latest"), release("1.7-prod", "1.7", "Dockerfile.prod", "prod", "latest-prod") ] diff --git a/.drone.yml b/.drone.yml index 92c210f..c6323f7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -38,58 +38,6 @@ trigger: exclude: - refs/heads/renovate/* ---- -kind: pipeline -type: docker -name: default_tests_1.6 - -platform: - os: linux - arch: amd64 - -steps: -- name: build test - pull: if-not-exists - image: thegeeklab/drone-docker-buildx - settings: - dockerfile: 1.6/Dockerfile - dry_run: true - platforms: linux/amd64,linux/arm64 - repo: mwalbeck/getgrav - -trigger: - event: - - pull_request - -depends_on: -- lint - ---- -kind: pipeline -type: docker -name: default_tests_1.6-prod - -platform: - os: linux - arch: amd64 - -steps: -- name: build test - pull: if-not-exists - image: thegeeklab/drone-docker-buildx - settings: - dockerfile: 1.6/Dockerfile.prod - dry_run: true - platforms: linux/amd64,linux/arm64 - repo: mwalbeck/getgrav - -trigger: - event: - - pull_request - -depends_on: -- lint - --- kind: pipeline type: docker @@ -142,119 +90,6 @@ trigger: depends_on: - lint ---- -kind: pipeline -type: docker -name: release_1.6 - -platform: - os: linux - arch: amd64 - -steps: -- name: determine tags - pull: if-not-exists - image: mwalbeck/determine-docker-tags:latest-distroless - environment: - APP_NAME: GRAV - DOCKERFILE_PATH: 1.6/Dockerfile - INCLUDE_MAJOR: negative - VERSION_TYPE: docker_env - -- name: build and publish - pull: if-not-exists - image: thegeeklab/drone-docker-buildx - settings: - dockerfile: 1.6/Dockerfile - password: - from_secret: dockerhub_password - platforms: linux/amd64,linux/arm64 - repo: mwalbeck/getgrav - username: - from_secret: dockerhub_username - -- name: notify - pull: if-not-exists - image: plugins/matrix - settings: - homeserver: https://matrix.mwalbeck.org - password: - from_secret: matrix_password - roomid: - from_secret: matrix_roomid - username: - from_secret: matrix_username - when: - status: - - failure - - success - -trigger: - branch: - - master - event: - - push - -depends_on: -- lint - ---- -kind: pipeline -type: docker -name: release_1.6-prod - -platform: - os: linux - arch: amd64 - -steps: -- name: determine tags - pull: if-not-exists - image: mwalbeck/determine-docker-tags:latest-distroless - environment: - APP_ENV: prod - APP_NAME: GRAV - DOCKERFILE_PATH: 1.6/Dockerfile.prod - INCLUDE_MAJOR: negative - VERSION_TYPE: docker_env - -- name: build and publish - pull: if-not-exists - image: thegeeklab/drone-docker-buildx - settings: - dockerfile: 1.6/Dockerfile.prod - password: - from_secret: dockerhub_password - platforms: linux/amd64,linux/arm64 - repo: mwalbeck/getgrav - username: - from_secret: dockerhub_username - -- name: notify - pull: if-not-exists - image: plugins/matrix - settings: - homeserver: https://matrix.mwalbeck.org - password: - from_secret: matrix_password - roomid: - from_secret: matrix_roomid - username: - from_secret: matrix_username - when: - status: - - failure - - success - -trigger: - branch: - - master - event: - - push - -depends_on: -- lint - --- kind: pipeline type: docker diff --git a/1.6/Dockerfile b/1.6/Dockerfile deleted file mode 100644 index 3bb3c21..0000000 --- a/1.6/Dockerfile +++ /dev/null @@ -1,84 +0,0 @@ -FROM php:7.3.29-fpm-buster@sha256:9fa6acffa9b016b8090e9f20b225fc2d83183b58c49d0290038c7b0b07ecdea8 - -SHELL [ "/bin/bash", "-exo", "pipefail", "-c" ] - -# renovate: datasource=github-tags depName=getgrav/grav versioning=semver -ENV GRAV_VERSION 1.6.31 -# renovate: datasource=github-tags depName=krakjoe/apcu versioning=semver -ENV PHP_APCU_VERSION v5.1.20 -# renovate: datasource=github-tags depName=php/pecl-file_formats-yaml versioning=semver -ENV PHP_YAML_VERSION 2.2.1 - -RUN groupadd --system foo; \ - useradd --no-log-init --system --gid foo --create-home foo; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - git \ - unzip \ - rsync \ - gosu \ - ##### Run dependencies - libzip4 \ - libyaml-0-2 \ - libpng16-16 \ - libjpeg62-turbo \ - libwebp6 \ - libfreetype6 \ - ##### Build dependencies - libwebp-dev \ - libjpeg-dev \ - libpng-dev \ - libfreetype6-dev \ - libyaml-dev \ - libzip-dev \ - ; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \ - docker-php-ext-install -j "$(nproc)" \ - zip \ - gd \ - opcache \ - ; \ - pecl install apcu-${PHP_APCU_VERSION:1}; \ - pecl install yaml-$PHP_YAML_VERSION; \ - \ - docker-php-ext-enable \ - apcu \ - yaml \ - ; \ - apt-get purge -y --auto-remove \ - libwebp-dev \ - libjpeg-dev \ - libpng-dev \ - libfreetype6-dev \ - libyaml-dev \ - libzip-dev \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"; \ - \ - git clone --branch $GRAV_VERSION https://github.com/getgrav/grav.git /usr/share/grav; \ - rm -rf \ - /usr/share/grav/.editorconfig \ - /usr/share/grav/.gitignore \ - /usr/share/grav/.travis.yml \ - /usr/share/grav/.git \ - /usr/share/grav/assets \ - /usr/share/grav/backup \ - /usr/share/grav/cache \ - /usr/share/grav/images \ - /usr/share/grav/logs \ - /usr/share/grav/tmp \ - /usr/share/grav/tests \ - /usr/share/grav/webserver-configs \ - /usr/share/grav/user \ - ; - -COPY entrypoint.sh /entrypoint.sh -COPY grav.ini $PHP_INI_DIR/conf.d/ - -EXPOSE 9000 - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/1.6/Dockerfile.prod b/1.6/Dockerfile.prod deleted file mode 100644 index 74b68da..0000000 --- a/1.6/Dockerfile.prod +++ /dev/null @@ -1,85 +0,0 @@ -FROM php:7.3.29-fpm-buster@sha256:9fa6acffa9b016b8090e9f20b225fc2d83183b58c49d0290038c7b0b07ecdea8 - -SHELL [ "/bin/bash", "-exo", "pipefail", "-c" ] - -# renovate: datasource=github-tags depName=getgrav/grav versioning=semver -ENV GRAV_VERSION 1.6.31 -# renovate: datasource=github-tags depName=krakjoe/apcu versioning=semver -ENV PHP_APCU_VERSION v5.1.20 -# renovate: datasource=github-tags depName=php/pecl-file_formats-yaml versioning=semver -ENV PHP_YAML_VERSION 2.2.1 - -RUN groupadd --force --system --gid 33 www-data; \ - useradd --no-log-init --system --gid www-data --no-create-home --uid 33 www-data || true; \ - \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - git \ - unzip \ - rsync \ - gosu \ - ##### Run dependencies - libzip4 \ - libyaml-0-2 \ - libpng16-16 \ - libjpeg62-turbo \ - libwebp6 \ - libfreetype6 \ - ##### Build dependencies - libwebp-dev \ - libjpeg-dev \ - libpng-dev \ - libfreetype6-dev \ - libyaml-dev \ - libzip-dev \ - ; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr; \ - docker-php-ext-install -j "$(nproc)" \ - zip \ - gd \ - opcache \ - ; \ - pecl install apcu-${PHP_APCU_VERSION:1}; \ - pecl install yaml-$PHP_YAML_VERSION; \ - \ - docker-php-ext-enable \ - apcu \ - yaml \ - ; \ - apt-get purge -y --auto-remove \ - libwebp-dev \ - libjpeg-dev \ - libpng-dev \ - libfreetype6-dev \ - libyaml-dev \ - libzip-dev \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"; \ - \ - git clone --branch $GRAV_VERSION https://github.com/getgrav/grav.git /usr/share/grav; \ - rm -rf \ - /usr/share/grav/.editorconfig \ - /usr/share/grav/.gitignore \ - /usr/share/grav/.travis.yml \ - /usr/share/grav/.git \ - /usr/share/grav/assets \ - /usr/share/grav/backup \ - /usr/share/grav/cache \ - /usr/share/grav/images \ - /usr/share/grav/logs \ - /usr/share/grav/tmp \ - /usr/share/grav/tests \ - /usr/share/grav/webserver-configs \ - /usr/share/grav/user \ - ; - -COPY entrypoint.prod.sh /entrypoint.sh -COPY grav.ini $PHP_INI_DIR/conf.d/ - -VOLUME [ "/var/www", "/tmp" ] -EXPOSE 9000 - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] diff --git a/README.md b/README.md index 4273faa..7143511 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,6 @@ You can find the image on Docker Hub and the source code can be found [here](htt * latest, 1.7, 1.7.* * latest-prod, 1.7-prod, 1.7.*-prod -* 1.6, 1.6.* -* 1.6-prod, 1.6.*-prod ## Usage -- 2.45.2