Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ jobs:
- name: Test that layers can be exported
run: |
make layer-php-${{ matrix.php_version }}
make layer-php-${{ matrix.php_version }}-fpm
env:
CPU: ${{ matrix.cpu }}

- name: Test that the "console" layer can be exported
run: make layer-console
if: ${{ matrix.php_version == 80 }}
env:
CPU: ${{ matrix.cpu }}

Expand Down
23 changes: 3 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,7 @@ docker-images-php-%:


# Build Lambda layers (zip files) *locally*
layers: layer-php-80 layer-php-81 layer-php-82 layer-php-83 layer-php-84 layer-php-80-fpm layer-php-81-fpm layer-php-82-fpm layer-php-83-fpm layer-php-84-fpm
# Build the console layer only once (x86 and single PHP version)
@if [ ${CPU} = "x86" ]; then \
$(MAKE) layer-console; \
fi
layer-console:
./utils/docker-zip-dir.sh bref/console-zip console
layers: layer-php-80 layer-php-81 layer-php-82 layer-php-83 layer-php-84
# This rule matches with a wildcard, for example `layer-php-80`.
# The `$*` variable will contained the matched part, in this case `php-80`.
layer-%:
Expand All @@ -58,15 +52,8 @@ layer-%:
# Uses the current AWS_PROFILE. Most users will not want to use this option
# as this will publish all layers to all regions + publish all Docker images.
upload-layers: upload-layers-php-80 upload-layers-php-81 upload-layers-php-82 upload-layers-php-83 upload-layers-php-84
# Upload the console layer only once (x86 and single PHP version)
@if [ ${CPU} = "x86" ]; then \
LAYER_NAME=console $(MAKE) -C ./utils/lambda-publish publish-parallel; \
fi
upload-layers-php-%:
# Upload the function layers to AWS
LAYER_NAME=${CPU_PREFIX}php-$* $(MAKE) -C ./utils/lambda-publish publish-parallel
# Upload the FPM layers to AWS
LAYER_NAME=${CPU_PREFIX}php-$*-fpm $(MAKE) -C ./utils/lambda-publish publish-parallel


# Publish Docker images to Docker Hub.
Expand All @@ -78,8 +65,7 @@ upload-to-docker-hub-php-%:

set -e ; \
for image in \
"bref/${CPU_PREFIX}php-$*" "bref/${CPU_PREFIX}php-$*-fpm" "bref/${CPU_PREFIX}php-$*-console" \
"bref/${CPU_PREFIX}build-php-$*" "bref/${CPU_PREFIX}php-$*-fpm-dev"; \
"bref/${CPU_PREFIX}php-$*" "bref/${CPU_PREFIX}build-php-$*" "bref/${CPU_PREFIX}php-$*-dev"; \
do \
docker tag $$image $$image:2 ; \
docker tag $$image $$image:${DOCKER_TAG} ; \
Expand All @@ -102,7 +88,4 @@ clean-%:
docker image rm --force bref/${CPU_PREFIX}build-php-$* \
bref/${CPU_PREFIX}php-$* \
bref/${CPU_PREFIX}php-$*-zip \
bref/${CPU_PREFIX}php-$*-fpm \
bref/${CPU_PREFIX}php-$*-fpm-zip \
bref/${CPU_PREFIX}php-$*-fpm-dev \
bref/${CPU_PREFIX}php-$*-console
bref/${CPU_PREFIX}php-$*-dev
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,8 @@ Anything we want to make available in AWS Lambda is possible by preparing the ri
bref/ # custom Bref files
extensions/ # PHP extensions
...
php-fpm-runtime/ # the built-in FPM runtime
etc/php/conf.d/ # automatically loaded php.ini files
bref.ini
bootstrap.php # (for the function layer only)

bootstrap # entrypoint of the runtime

Expand Down
68 changes: 14 additions & 54 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group "default" {
targets = ["build-php", "php", "php-fpm", "console-zip", "console", "php-fpm-dev"]
targets = ["build-php", "php", "php-dev"]
}

variable "CPU" {
Expand All @@ -23,9 +23,9 @@ variable "PHP_COMPILATION_FLAGS" {

target "build-php" {
dockerfile = "php-${PHP_VERSION}/Dockerfile"
target = "build-environment"
tags = ["bref/${CPU_PREFIX}build-php-${PHP_VERSION}"]
args = {
target = "build-environment"
tags = ["bref/${CPU_PREFIX}build-php-${PHP_VERSION}"]
args = {
"IMAGE_VERSION_SUFFIX" = "${IMAGE_VERSION_SUFFIX}"
"PHP_COMPILATION_FLAGS" = "${PHP_COMPILATION_FLAGS}"
}
Expand All @@ -34,9 +34,9 @@ target "build-php" {

target "php" {
dockerfile = "php-${PHP_VERSION}/Dockerfile"
target = "function"
tags = ["bref/${CPU_PREFIX}php-${PHP_VERSION}"]
args = {
target = "function"
tags = ["bref/${CPU_PREFIX}php-${PHP_VERSION}"]
args = {
"IMAGE_VERSION_SUFFIX" = "${IMAGE_VERSION_SUFFIX}"
"PHP_COMPILATION_FLAGS" = "${PHP_COMPILATION_FLAGS}"
}
Expand All @@ -46,58 +46,18 @@ target "php" {
platforms = ["${DOCKER_PLATFORM}"]
}

target "php-fpm" {
target "php-dev" {
dockerfile = "php-${PHP_VERSION}/Dockerfile"
target = "fpm"
tags = ["bref/${CPU_PREFIX}php-${PHP_VERSION}-fpm"]
args = {
target = "dev"
tags = ["bref/${CPU_PREFIX}php-${PHP_VERSION}-dev"]
args = {
"IMAGE_VERSION_SUFFIX" = "${IMAGE_VERSION_SUFFIX}"
"PHP_COMPILATION_FLAGS" = "${PHP_COMPILATION_FLAGS}"
}
contexts = {
"bref/${CPU_PREFIX}build-php-${PHP_VERSION}" = "target:build-php"
"bref/${CPU_PREFIX}php-${PHP_VERSION}" = "target:php"
}
platforms = ["${DOCKER_PLATFORM}"]
}

target "console-zip" {
context = "layers/console"
target = "console-zip"
tags = ["bref/console-zip"]
args = {
PHP_VERSION = "${PHP_VERSION}"
CPU_PREFIX = "${CPU_PREFIX}"
}
platforms = ["${DOCKER_PLATFORM}"]
}

target "console" {
context = "layers/console"
target = "console"
tags = ["bref/${CPU_PREFIX}php-${PHP_VERSION}-console"]
args = {
PHP_VERSION = "${PHP_VERSION}"
CPU_PREFIX = "${CPU_PREFIX}"
}
contexts = {
"bref/${CPU_PREFIX}build-php-${PHP_VERSION}" = "target:build-php"
"bref/${CPU_PREFIX}php-${PHP_VERSION}" = "target:php"
}
platforms = ["${DOCKER_PLATFORM}"]
}

target "php-fpm-dev" {
context = "layers/fpm-dev"
tags = ["bref/${CPU_PREFIX}php-${PHP_VERSION}-fpm-dev"]
args = {
PHP_VERSION = "${PHP_VERSION}"
CPU_PREFIX = "${CPU_PREFIX}"
}
contexts = {
"bref/${CPU_PREFIX}build-php-${PHP_VERSION}" = "target:build-php"
"bref/${CPU_PREFIX}php-${PHP_VERSION}" = "target:php"
"bref/${CPU_PREFIX}php-${PHP_VERSION}-fpm" = "target:php-fpm"
"bref/local-api-gateway" = "docker-image://bref/local-api-gateway:latest"
"bref/${CPU_PREFIX}php-${PHP_VERSION}" = "target:php"
"bref/local-api-gateway" = "docker-image://bref/local-api-gateway:latest"
}
platforms = ["${DOCKER_PLATFORM}"]
}
22 changes: 0 additions & 22 deletions layers/console/Dockerfile

This file was deleted.

3 changes: 0 additions & 3 deletions layers/console/README.md

This file was deleted.

27 changes: 0 additions & 27 deletions layers/console/bootstrap.sh

This file was deleted.

45 changes: 0 additions & 45 deletions layers/fpm-dev/Dockerfile

This file was deleted.

27 changes: 0 additions & 27 deletions layers/fpm/bootstrap.sh

This file was deleted.

50 changes: 0 additions & 50 deletions layers/fpm/bref.ini

This file was deleted.

27 changes: 0 additions & 27 deletions layers/function/bootstrap.sh

This file was deleted.

Loading
Loading