Switch to building docker containers with buildx and build arm64 version, fixes #84 #179

Merged
mwalbeck merged 2 commits from arm64-builds into master 2021-07-06 23:33:03 +00:00
5 changed files with 0 additions and 340 deletions
Showing only changes of commit b2580c0b1c - Show all commits

View File

@ -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")
]

View File

@ -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

View File

@ -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"]

View File

@ -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"]

View File

@ -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