diff --git a/.drone.yml b/.drone.yml index b568dd9..059bf13 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,21 +2,22 @@ kind: pipeline name: php-runtime-8.0 +workspace: + base: /workspace + path: src/github.com/bitpoke/stack-runtimes + steps: - &step name: setup docker pull: always - image: quay.io/presslabs/bfc + image: docker.io/bitpoke/build:v0.3.0-3.g7069e76 environment: &baseEnv TAG_SUFFIX: ${DRONE_BRANCH/master/} TEST_HOSTNAME: docker commands: - - dockerize -wait unix:///var/run/docker.sock -timeout 10s + - dockerize -wait unix:///workspace/docker.sock -timeout 10s - docker info - make -C php pull-$DRONE_STAGE_NAME - volumes: - - name: dockersock - path: /var/run - <<: *step name: build image @@ -35,101 +36,40 @@ steps: pull: default environment: <<: *baseEnv - DOCKER_USER: "presslabs+drone" + DOCKER_USER: + from_secret: DOCKER_USER DOCKER_PASSWORD: - from_secret: QUAY_TOKEN + from_secret: DOCKER_PASSWORD commands: - - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" quay.io + - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" docker.io - make -C php push-$DRONE_STAGE_NAME services: - name: docker - image: docker:dind + image: docker:20.10.8-dind privileged: true - volumes: - - name: dockersock - path: /var/run - -volumes: -- name: dockersock - temp: {} - - + commands: + - /usr/local/bin/dockerd-entrypoint.sh dockerd --host "unix:///workspace/docker.sock" --storage-driver overlay2 --log-level error --- kind: pipeline name: php-runtime-7.4 -steps: -- &step - name: setup docker - pull: always - image: quay.io/presslabs/bfc - environment: &baseEnv - TAG_SUFFIX: ${DRONE_BRANCH/master/} - TEST_HOSTNAME: docker - commands: - - dockerize -wait unix:///var/run/docker.sock -timeout 10s - - docker info - - make -C php pull-$DRONE_STAGE_NAME - volumes: - - name: dockersock - path: /var/run - -- <<: *step - name: build image - pull: default - commands: - - make -C php $DRONE_STAGE_NAME - -- <<: *step - name: test image - pull: default - commands: - - make -C php test-$DRONE_STAGE_NAME - -- <<: *step - name: publish - pull: default - environment: - <<: *baseEnv - DOCKER_USER: "presslabs+drone" - DOCKER_PASSWORD: - from_secret: QUAY_TOKEN - commands: - - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" quay.io - - make -C php push-$DRONE_STAGE_NAME - -services: -- name: docker - image: docker:dind - privileged: true - volumes: - - name: dockersock - path: /var/run - -volumes: -- name: dockersock - temp: {} - ---- -kind: pipeline -name: php-runtime-7.3 +workspace: + base: /workspace + path: src/github.com/bitpoke/stack-runtimes steps: - &step name: setup docker pull: always - image: quay.io/presslabs/bfc + image: docker.io/bitpoke/build:v0.3.0-3.g7069e76 environment: &baseEnv TAG_SUFFIX: ${DRONE_BRANCH/master/} TEST_HOSTNAME: docker commands: - - dockerize -wait unix:///var/run/docker.sock -timeout 10s + - dockerize -wait unix:///workspace/docker.sock -timeout 10s - docker info - make -C php pull-$DRONE_STAGE_NAME - volumes: - - name: dockersock - path: /var/run - <<: *step name: build image @@ -148,165 +88,44 @@ steps: pull: default environment: <<: *baseEnv - DOCKER_USER: "presslabs+drone" + DOCKER_USER: + from_secret: DOCKER_USER DOCKER_PASSWORD: - from_secret: QUAY_TOKEN + from_secret: DOCKER_PASSWORD commands: - - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" quay.io + - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" docker.io - make -C php push-$DRONE_STAGE_NAME services: - name: docker - image: docker:dind + image: docker:20.10.8-dind privileged: true - volumes: - - name: dockersock - path: /var/run - -volumes: -- name: dockersock - temp: {} - ---- -kind: pipeline -name: wordpress-runtime-bedrock-php-8.0 - -depends_on: - - php-runtime-8.0 - -steps: -- &step - name: setup docker - pull: always - image: quay.io/presslabs/bfc - environment: &baseEnv - TAG_SUFFIX: ${DRONE_BRANCH/master/} - TEST_HOSTNAME: docker - commands: - - dockerize -wait unix:///var/run/docker.sock -timeout 10s - - docker info - - make -C wordpress pull-$DRONE_STAGE_NAME - volumes: - - name: dockersock - path: /var/run - -- <<: *step - name: build image - pull: default commands: - - make -C wordpress $DRONE_STAGE_NAME - -- <<: *step - name: test image - pull: default - commands: - - make -C wordpress test-$DRONE_STAGE_NAME - -- <<: *step - name: publish - pull: default - environment: - <<: *baseEnv - DOCKER_USER: "presslabs+drone" - DOCKER_PASSWORD: - from_secret: QUAY_TOKEN - commands: - - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" quay.io - - make -C wordpress push-$DRONE_STAGE_NAME - -services: -- name: docker - image: docker:dind - privileged: true - volumes: - - name: dockersock - path: /var/run - -volumes: -- name: dockersock - temp: {} - + - /usr/local/bin/dockerd-entrypoint.sh dockerd --host "unix:///workspace/docker.sock" --storage-driver overlay2 --log-level error --- kind: pipeline -name: wordpress-runtime-5.7 +name: wordpress-runtime-bedrock depends_on: - php-runtime-7.4 -steps: -- &step - name: setup docker - pull: always - image: quay.io/presslabs/bfc - environment: &baseEnv - TAG_SUFFIX: ${DRONE_BRANCH/master/} - TEST_HOSTNAME: docker - commands: - - dockerize -wait unix:///var/run/docker.sock -timeout 10s - - docker info - - make -C wordpress pull-$DRONE_STAGE_NAME - volumes: - - name: dockersock - path: /var/run - -- <<: *step - name: build image - pull: default - commands: - - make -C wordpress $DRONE_STAGE_NAME - -- <<: *step - name: test image - pull: default - commands: - - make -C wordpress test-$DRONE_STAGE_NAME - -- <<: *step - name: publish - pull: default - environment: - <<: *baseEnv - DOCKER_USER: "presslabs+drone" - DOCKER_PASSWORD: - from_secret: QUAY_TOKEN - commands: - - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" quay.io - - make -C wordpress push-$DRONE_STAGE_NAME - -services: -- name: docker - image: docker:dind - privileged: true - volumes: - - name: dockersock - path: /var/run - -volumes: -- name: dockersock - temp: {} ---- -kind: pipeline -name: wordpress-runtime-5.6 - -depends_on: - - php-runtime-7.4 +workspace: + base: /workspace + path: src/github.com/bitpoke/stack-runtimes steps: - &step name: setup docker pull: always - image: quay.io/presslabs/bfc + image: docker.io/bitpoke/build:v0.3.0-3.g7069e76 environment: &baseEnv TAG_SUFFIX: ${DRONE_BRANCH/master/} TEST_HOSTNAME: docker commands: - - dockerize -wait unix:///var/run/docker.sock -timeout 10s + - dockerize -wait unix:///workspace/docker.sock -timeout 10s - docker info - make -C wordpress pull-$DRONE_STAGE_NAME - volumes: - - name: dockersock - path: /var/run - <<: *step name: build image @@ -325,162 +144,44 @@ steps: pull: default environment: <<: *baseEnv - DOCKER_USER: "presslabs+drone" + DOCKER_USER: + from_secret: DOCKER_USER DOCKER_PASSWORD: - from_secret: QUAY_TOKEN + from_secret: DOCKER_PASSWORD commands: - - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" quay.io + - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" docker.io - make -C wordpress push-$DRONE_STAGE_NAME services: - name: docker - image: docker:dind + image: docker:20.10.8-dind privileged: true - volumes: - - name: dockersock - path: /var/run - -volumes: -- name: dockersock - temp: {} ---- -kind: pipeline -name: wordpress-runtime-5.5 - -depends_on: - - php-runtime-7.4 - -steps: -- &step - name: setup docker - pull: always - image: quay.io/presslabs/bfc - environment: &baseEnv - TAG_SUFFIX: ${DRONE_BRANCH/master/} - TEST_HOSTNAME: docker - commands: - - dockerize -wait unix:///var/run/docker.sock -timeout 10s - - docker info - - make -C wordpress pull-$DRONE_STAGE_NAME - volumes: - - name: dockersock - path: /var/run - -- <<: *step - name: build image - pull: default - commands: - - make -C wordpress $DRONE_STAGE_NAME - -- <<: *step - name: test image - pull: default - commands: - - make -C wordpress test-$DRONE_STAGE_NAME - -- <<: *step - name: publish - pull: default - environment: - <<: *baseEnv - DOCKER_USER: "presslabs+drone" - DOCKER_PASSWORD: - from_secret: QUAY_TOKEN commands: - - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" quay.io - - make -C wordpress push-$DRONE_STAGE_NAME - -services: -- name: docker - image: docker:dind - privileged: true - volumes: - - name: dockersock - path: /var/run + - /usr/local/bin/dockerd-entrypoint.sh dockerd --host "unix:///workspace/docker.sock" --storage-driver overlay2 --log-level error -volumes: -- name: dockersock - temp: {} --- kind: pipeline -name: wordpress-runtime-bedrock +name: wordpress-runtime-5.7 depends_on: - - php-runtime-7.4 - -steps: -- &step - name: setup docker - pull: always - image: quay.io/presslabs/bfc - environment: &baseEnv - TAG_SUFFIX: ${DRONE_BRANCH/master/} - TEST_HOSTNAME: docker - commands: - - dockerize -wait unix:///var/run/docker.sock -timeout 10s - - docker info - - make -C wordpress pull-$DRONE_STAGE_NAME - volumes: - - name: dockersock - path: /var/run - -- <<: *step - name: build image - pull: default - commands: - - make -C wordpress $DRONE_STAGE_NAME + - wordpress-runtime-bedrock -- <<: *step - name: test image - pull: default - commands: - - make -C wordpress test-$DRONE_STAGE_NAME - -- <<: *step - name: publish - pull: default - environment: - <<: *baseEnv - DOCKER_USER: "presslabs+drone" - DOCKER_PASSWORD: - from_secret: QUAY_TOKEN - commands: - - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" quay.io - - make -C wordpress push-$DRONE_STAGE_NAME - -services: -- name: docker - image: docker:dind - privileged: true - volumes: - - name: dockersock - path: /var/run - -volumes: -- name: dockersock - temp: {} ---- -kind: pipeline -name: wordpress-runtime-bedrock-php-7.3 - -depends_on: - - php-runtime-7.3 +workspace: + base: /workspace + path: src/github.com/bitpoke/stack-runtimes steps: - &step name: setup docker pull: always - image: quay.io/presslabs/bfc + image: docker.io/bitpoke/build:v0.3.0-3.g7069e76 environment: &baseEnv TAG_SUFFIX: ${DRONE_BRANCH/master/} TEST_HOSTNAME: docker commands: - - dockerize -wait unix:///var/run/docker.sock -timeout 10s + - dockerize -wait unix:///workspace/docker.sock -timeout 10s - docker info - make -C wordpress pull-$DRONE_STAGE_NAME - volumes: - - name: dockersock - path: /var/run - <<: *step name: build image @@ -499,21 +200,17 @@ steps: pull: default environment: <<: *baseEnv - DOCKER_USER: "presslabs+drone" + DOCKER_USER: + from_secret: DOCKER_USER DOCKER_PASSWORD: - from_secret: QUAY_TOKEN + from_secret: DOCKER_PASSWORD commands: - - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" quay.io + - docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD" docker.io - make -C wordpress push-$DRONE_STAGE_NAME services: - name: docker - image: docker:dind + image: docker:20.10.8-dind privileged: true - volumes: - - name: dockersock - path: /var/run - -volumes: -- name: dockersock - temp: {} + commands: + - /usr/local/bin/dockerd-entrypoint.sh dockerd --host "unix:///workspace/docker.sock" --storage-driver overlay2 --log-level error diff --git a/Makefile b/Makefile index 2b611b9..ea28429 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,15 @@ include common.Makefile -REGISTRY ?= quay.io/presslabs -PHP_VERSION ?= 7.4.11 -WORDPRESS_VERSION ?= 5.5.1 +REGISTRY ?= docker.io/bitpoke +PHP_VERSION ?= 7.4.22 +WORDPRESS_VERSION ?= 5.8 ifndef CI TAG_SUFFIX ?= canary endif BUILD_TAG ?= build -# The PHP series for which this version of WordPress builds the default tag, eg. quay.io/presslabs/wordpress-runtime:5.2.2 +# The PHP series for which this version of WordPress builds the default tag, eg. docker.io/bitpoke/wordpress-runtime:5.2.2 WORDPRESS_PHP_SERIES := $(shell ./hack/wordpress-php-series $(WORDPRESS_VERSION)) # The PHP series for which to build the default bedrock tag diff --git a/hack/container-structure-test b/hack/container-structure-test index f05694a..82a5569 100755 --- a/hack/container-structure-test +++ b/hack/container-structure-test @@ -25,6 +25,6 @@ cd ${PROJECT_ROOT} exec docker run --rm -w /workspace \ -v $(pwd):/workspace \ - -v /var/run/docker.sock:/var/run/docker.sock \ + -v /workspace/docker.sock:/var/run/docker.sock \ gcr.io/gcp-runtimes/container-structure-test:v1.8.0 \ "$@" diff --git a/project.Makefile b/project.Makefile index 7385a65..7ed9241 100644 --- a/project.Makefile +++ b/project.Makefile @@ -2,7 +2,7 @@ ifndef __PROJECT_MAKEFILE__ __PROJECT_MAKEFILE__ := included -REGISTRY ?= quay.io/presslabs +REGISTRY ?= docker.io/bitpoke ifndef CI diff --git a/wordpress/Dockerfile-5.5 b/wordpress/Dockerfile-5.5 deleted file mode 100644 index d633461..0000000 --- a/wordpress/Dockerfile-5.5 +++ /dev/null @@ -1,10 +0,0 @@ -ARG BASE_IMAGE=quay.io/presslabs/wordpress-runtime:bedrock-php-7.4 -FROM ${BASE_IMAGE} as bedrock -ENV WORDPRESS_VERSION=5.5.5 -ENV WP_CONTENT_DIR=${DOCUMENT_ROOT}/wp-content -ENV STACK_MEDIA_PATH=/wp-content/uploads -RUN set -ex \ - && wp core download --path=web/wp --version=${WORDPRESS_VERSION} \ - && cp /usr/local/docker/webroot/* /app/web/ -ONBUILD COPY --chown=www-data:www-data config /app/config -ONBUILD COPY --chown=www-data:www-data wp-content /app/web/wp-content diff --git a/wordpress/Dockerfile-5.6 b/wordpress/Dockerfile-5.6 deleted file mode 100644 index 363a8b0..0000000 --- a/wordpress/Dockerfile-5.6 +++ /dev/null @@ -1,10 +0,0 @@ -ARG BASE_IMAGE=quay.io/presslabs/wordpress-runtime:bedrock-php-7.4 -FROM ${BASE_IMAGE} as bedrock -ENV WORDPRESS_VERSION=5.6.4 -ENV WP_CONTENT_DIR=${DOCUMENT_ROOT}/wp-content -ENV STACK_MEDIA_PATH=/wp-content/uploads -RUN set -ex \ - && wp core download --path=web/wp --version=${WORDPRESS_VERSION} \ - && cp /usr/local/docker/webroot/* /app/web/ -ONBUILD COPY --chown=www-data:www-data config /app/config -ONBUILD COPY --chown=www-data:www-data wp-content /app/web/wp-content diff --git a/wordpress/Dockerfile-5.7 b/wordpress/Dockerfile-5.7 index 767e720..77cc243 100644 --- a/wordpress/Dockerfile-5.7 +++ b/wordpress/Dockerfile-5.7 @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=quay.io/presslabs/wordpress-runtime:bedrock-php-7.4 +ARG BASE_IMAGE=docker.io/bitpoke/wordpress-runtime:bedrock-php-7.4 FROM ${BASE_IMAGE} as bedrock ENV WORDPRESS_VERSION=5.7.2 ENV WP_CONTENT_DIR=${DOCUMENT_ROOT}/wp-content diff --git a/wordpress/Dockerfile-bedrock b/wordpress/Dockerfile-bedrock index 500595c..1444d70 100644 --- a/wordpress/Dockerfile-bedrock +++ b/wordpress/Dockerfile-bedrock @@ -1,4 +1,4 @@ -ARG PHP_BASE_IMAGE=quay.io/presslabs/php-runtime:7.4 +ARG PHP_BASE_IMAGE=docker.io/bitpoke/php-runtime:7.4 FROM ${PHP_BASE_IMAGE} as bedrock ENV WP_CLI_VERSION=2.4.0 diff --git a/wordpress/Dockerfile-bedrock-build b/wordpress/Dockerfile-bedrock-build index de23007..18763d2 100644 --- a/wordpress/Dockerfile-bedrock-build +++ b/wordpress/Dockerfile-bedrock-build @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=quay.io/presslabs/wordpress-runtime:bedrock +ARG BASE_IMAGE=docker.io/bitpoke/wordpress-runtime:bedrock FROM ${BASE_IMAGE} as bedrock WORKDIR /src # Install project dependencies as first build step for child images so that we diff --git a/wordpress/Dockerfile-bedrock-build-php-7.3 b/wordpress/Dockerfile-bedrock-build-php-8.0 similarity index 87% rename from wordpress/Dockerfile-bedrock-build-php-7.3 rename to wordpress/Dockerfile-bedrock-build-php-8.0 index 7fa9aa2..649473a 100644 --- a/wordpress/Dockerfile-bedrock-build-php-7.3 +++ b/wordpress/Dockerfile-bedrock-build-php-8.0 @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=quay.io/presslabs/wordpress-runtime:bedrock-php-7.3 +ARG BASE_IMAGE=docker.io/bitpoke/wordpress-runtime:bedrock-php-8.0 FROM ${BASE_IMAGE} as bedrock WORKDIR /src # Install project dependencies as first build step for child images so that we diff --git a/wordpress/Dockerfile-bedrock-php-7.3 b/wordpress/Dockerfile-bedrock-php-7.3 deleted file mode 100644 index a8a23f7..0000000 --- a/wordpress/Dockerfile-bedrock-php-7.3 +++ /dev/null @@ -1,21 +0,0 @@ -ARG PHP_BASE_IMAGE=quay.io/presslabs/php-runtime:7.3 -FROM ${PHP_BASE_IMAGE} as bedrock - -ENV WP_CLI_VERSION=2.2.0 -ENV WP_CLI_CONFIG_PATH=/app/wp-cli.yml -ENV DOCUMENT_ROOT=/app/web -ENV WP_CONTENT_DIR=${DOCUMENT_ROOT}/app -ENV STACK_MEDIA_PATH=/app/uploads -USER root -COPY docker/build-scripts /usr/local/docker/build-scripts/ -RUN set -ex \ - && /usr/local/docker/build-scripts/install-wp-cli \ - && rm -rf /app \ - && mkdir -p /app/web /src \ - && { \ - echo "path: $DOCUMENT_ROOT/wp"; \ - } | tee /app/wp-cli.yml >&2 \ - && chown -R www-data:www-data /app /src - -COPY --chown=www-data:www-data ./docker /usr/local/docker -USER www-data diff --git a/wordpress/Dockerfile-bedrock-php-8.0 b/wordpress/Dockerfile-bedrock-php-8.0 index b99982c..ad3f5df 100644 --- a/wordpress/Dockerfile-bedrock-php-8.0 +++ b/wordpress/Dockerfile-bedrock-php-8.0 @@ -1,4 +1,4 @@ -ARG PHP_BASE_IMAGE=quay.io/presslabs/php-runtime:8.0 +ARG PHP_BASE_IMAGE=docker.io/bitpoke/php-runtime:8.0 FROM ${PHP_BASE_IMAGE} as bedrock ENV WP_CLI_VERSION=2.2.0 diff --git a/wordpress/Makefile b/wordpress/Makefile index 75ab1d1..846f62a 100644 --- a/wordpress/Makefile +++ b/wordpress/Makefile @@ -20,5 +20,14 @@ include ../docker.Makefile wordpress-runtime-bedrock: wordpress-runtime-bedrock-build push-wordpress-runtime-bedrock: push-wordpress-runtime-bedrock-build -# Modify build targets for bedrock-php-7.3 so that we build, test and publish bedrock-php-7.3 and bedrock-build-php-7.3 variants -.build/wordpress-runtime-bedrock-php-7.3: .build/wordpress-runtime-bedrock-build-php-7.3 +# Modify build targets for bedrock-php-8.0 so that we build, test and publish bedrock-php-8.0 and bedrock-build-php-8.0 variants +.build/wordpress-runtime-bedrock-build-php-8.0: .build/wordpress-runtime-bedrock-php-8.0 +.build/wordpress-runtime-bedrock-build-php-8.0: BASE_IMAGE := local.build/wordpress-runtime-bedrock-php-8.0 +.build/wordpress-runtime-bedrock-build-php-8.0: DOCKER_BUILD := docker build + +.build/tag-wordpress-runtime-bedrock-build-php-8.0: .build/tag-wordpress-runtime-bedrock-php-8.0 + +.build/test-wordpress-runtime-bedrock-build-php-8.0: .build/test-wordpress-runtime-bedrock-build-php-8.0 ; + +wordpress-runtime-bedrock-php-8.0: wordpress-runtime-bedrock-build-php-8.0 +push-wordpress-runtime-bedrock-php-8.0: push-wordpress-runtime-bedrock-build-php-8.0