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
6 changes: 3 additions & 3 deletions .devcontainer/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM node:22.23.4-bookworm-slim@sha256:4b150b48b4116e2a22f2c39cc27025fbf4f153e2078fd3b14d159fdb5c7279da AS node

Check warning on line 1 in .devcontainer/docker/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mm_FLvOvIBV9vpF5&open=AaH0mm_FLvOvIBV9vpF5&pullRequest=353

FROM composer:2.11.0@sha256:278dfc7bd35169965d03f87194816f43bf4e6b6ea61707c2114e52ad12fe24ce AS composer

Check warning on line 3 in .devcontainer/docker/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mm_FLvOvIBV9vpF6&open=AaH0mm_FLvOvIBV9vpF6&pullRequest=353

FROM php:8.4.27-cli-bookworm@sha256:b3e907a1108629c562c4bb313ce3449e34d49991f6bb2487913f6146f47200fe AS brotli-build
FROM php:8.4.28-cli-bookworm@sha256:85da896b3eeb8bcd83fe612e51a529b7d5983a1fab92ef5f63c7ac6e2842fc46 AS brotli-build

Check warning on line 5 in .devcontainer/docker/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mm_FLvOvIBV9vpF7&open=AaH0mm_FLvOvIBV9vpF7&pullRequest=353

COPY .central-apt-source/docker/apt/require-fixed-bookworm-apt.sh /usr/local/share/sample-app/require-fixed-bookworm-apt.sh
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
Expand All @@ -16,9 +16,9 @@
&& /out/verify-system-brotli \
&& cp /usr/src/brotli-inputs/version /usr/src/brotli-inputs/install-vendor.sh /usr/src/brotli-inputs/verify-runtime.php /out/

FROM docker:29.9.2-cli@sha256:5e6baf67325a79f64ed3bed6863954d5e05d0f3d4e57cbdb14809346814bbfdb AS docker-cli

Check warning on line 19 in .devcontainer/docker/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mm_FLvOvIBV9vpF8&open=AaH0mm_FLvOvIBV9vpF8&pullRequest=353

FROM golang:1.27.3-bookworm@sha256:d9b6a1beb9474adc2a1ce842573639b44b2a0dd49b6669f51d3821baf9ec37c9 AS go-tools

Check warning on line 21 in .devcontainer/docker/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mm_FLvOvIBV9vpF9&open=AaH0mm_FLvOvIBV9vpF9&pullRequest=353

ENV CGO_ENABLED=0 GOTOOLCHAIN=local
COPY docker/go-tools/compose-go-net.patch /tmp/compose-go-net.patch
Expand Down Expand Up @@ -49,7 +49,7 @@
go version -m /out/docker-compose; \
/out/docker-compose version

FROM rust:1.99.1-slim-bookworm@sha256:24707e70a4f1e23d9a7b25202ec43126d28a52294b96aad5c670df1fd1f1d400 AS rust

Check warning on line 52 in .devcontainer/docker/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mm_FLvOvIBV9vpF-&open=AaH0mm_FLvOvIBV9vpF-&pullRequest=353

RUN set -eux; \
rm -rf /usr/local/rustup/downloads /usr/local/rustup/tmp; \
Expand All @@ -59,9 +59,9 @@
rustc --version; \
cargo --version

FROM mariadb:11.4.13@sha256:d1891ede5a559f1086f55053bb8cc1569b0298338c4d72d71725a7f74f6ba620 AS mysql-seed

Check warning on line 62 in .devcontainer/docker/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mm_FLvOvIBV9vpF_&open=AaH0mm_FLvOvIBV9vpF_&pullRequest=353

ENV MYSQL_ROOT_PASSWORD=password \

Check warning on line 64 in .devcontainer/docker/Dockerfile

View workflow job for this annotation

GitHub Actions / Qualify candidate linux/arm64

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 64 in .devcontainer/docker/Dockerfile

View workflow job for this annotation

GitHub Actions / Qualify candidate linux/arm64

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_ROOT_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 64 in .devcontainer/docker/Dockerfile

View workflow job for this annotation

GitHub Actions / Qualify candidate linux/amd64

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

Check warning on line 64 in .devcontainer/docker/Dockerfile

View workflow job for this annotation

GitHub Actions / Qualify candidate linux/amd64

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_ROOT_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
MYSQL_ROOT_HOST=% \
MYSQL_DATABASE=sample \
MYSQL_USER=laravel \
Expand Down Expand Up @@ -129,7 +129,7 @@
.; \
test -s /tmp/sample-app-mysql-seed.tar

FROM php:8.4.27-cli-bookworm@sha256:b3e907a1108629c562c4bb313ce3449e34d49991f6bb2487913f6146f47200fe
FROM php:8.4.28-cli-bookworm@sha256:85da896b3eeb8bcd83fe612e51a529b7d5983a1fab92ef5f63c7ac6e2842fc46

Check warning on line 132 in .devcontainer/docker/Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mm_FLvOvIBV9vpGA&open=AaH0mm_FLvOvIBV9vpGA&pullRequest=353

COPY .central-apt-source/docker/apt/require-fixed-bookworm-apt.sh /usr/local/share/sample-app/require-fixed-bookworm-apt.sh
COPY --from=brotli-build /out /usr/local/share/sample-app/brotli
Expand Down Expand Up @@ -174,7 +174,7 @@
COPY .devcontainer/docker/verify-php-trust.php .devcontainer/docker/verify-node-trust.mjs /usr/local/share/sample-app/

RUN set -eux; \
php -r 'exit(PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION === 4 && PHP_VERSION_ID >= 80427 ? 0 : 1);'; \
php -r 'exit(PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION === 4 && PHP_VERSION_ID >= 80428 ? 0 : 1);'; \
php /usr/local/share/sample-app/verify-php-trust.php "$(command -v composer)"; \
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime; \
echo "${TZ}" > /etc/timezone; \
Expand Down
8 changes: 5 additions & 3 deletions .devcontainer/docker/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Development image build inputs

The development recipe uses the same pinned PHP 8.4.27 Bookworm index for its
The development recipe uses the same pinned PHP 8.4.28 Bookworm index for its
Brotli builder and final stage, on both amd64 and arm64. Its shared APT preflight
comes from the accepted immutable source in
[central `docker/apt`](https://github.com/durable-workflow/.github/tree/18783be6bef737cc778e4c7282a8797e39daa61a/docker/apt).
That source records the exact parent descriptors and publisher SPDX package
inventory; installed-image acceptance is a separate result.
That source records the exact descriptors and publisher SPDX package inventory of
the earlier PHP 8.4.27 parent; it does not record the 8.4.28 parent. The preflight
itself does not depend on the parent digest: it checks the installed native
APT/libapt pair in each stage. Installed-image acceptance is a separate result.

Both image workflows check out that exact central commit without persisted
credentials into `.central-apt-source`, then verify its actual HEAD and the
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM composer:2.11.0@sha256:278dfc7bd35169965d03f87194816f43bf4e6b6ea61707c2114e52ad12fe24ce AS composer

Check warning on line 1 in Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mnEOLvOvIBV9vpGB&open=AaH0mnEOLvOvIBV9vpGB&pullRequest=353

FROM php:8.4.27-cli-bookworm@sha256:b3e907a1108629c562c4bb313ce3449e34d49991f6bb2487913f6146f47200fe AS brotli-build
FROM php:8.4.28-cli-bookworm@sha256:85da896b3eeb8bcd83fe612e51a529b7d5983a1fab92ef5f63c7ac6e2842fc46 AS brotli-build

Check warning on line 3 in Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mnEOLvOvIBV9vpGC&open=AaH0mnEOLvOvIBV9vpGC&pullRequest=353

COPY .central-apt-source/docker/apt/require-fixed-bookworm-apt.sh /usr/local/share/sample-app/require-fixed-bookworm-apt.sh
COPY --from=composer /usr/bin/composer /usr/local/bin/composer
Expand All @@ -14,7 +14,7 @@
&& /out/verify-system-brotli \
&& cp /usr/src/brotli-inputs/version /usr/src/brotli-inputs/install-vendor.sh /usr/src/brotli-inputs/verify-runtime.php /out/

FROM php:8.4.27-cli-bookworm@sha256:b3e907a1108629c562c4bb313ce3449e34d49991f6bb2487913f6146f47200fe AS base
FROM php:8.4.28-cli-bookworm@sha256:85da896b3eeb8bcd83fe612e51a529b7d5983a1fab92ef5f63c7ac6e2842fc46 AS base

Check warning on line 17 in Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mnEOLvOvIBV9vpGD&open=AaH0mnEOLvOvIBV9vpGD&pullRequest=353

COPY .central-apt-source/docker/apt/require-fixed-bookworm-apt.sh /usr/local/share/sample-app/require-fixed-bookworm-apt.sh
COPY --from=brotli-build /out /usr/local/share/sample-app/brotli
Expand Down Expand Up @@ -62,7 +62,7 @@
&& composer dump-autoload --optimize

# ── Frontend assets ──────────────────────────────────────
FROM node:22.23.4-bookworm-slim@sha256:4b150b48b4116e2a22f2c39cc27025fbf4f153e2078fd3b14d159fdb5c7279da AS assets

Check warning on line 65 in Dockerfile

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use either the version tag or the digest for the image instead of both.

See more on https://sonarcloud.io/project/issues?id=durable-workflow_sample-app&issues=AaH0mnEOLvOvIBV9vpGE&open=AaH0mnEOLvOvIBV9vpGE&pullRequest=353

WORKDIR /app
COPY docker/verify-node-trust.mjs /usr/local/share/sample-app/verify-node-trust.mjs
Expand Down
4 changes: 2 additions & 2 deletions docker/verify-runtime-trust.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

final class ProductionTrustRefused extends RuntimeException {}

if (PHP_MAJOR_VERSION !== 8 || PHP_MINOR_VERSION !== 4 || PHP_VERSION_ID < 80427) {
throw new ProductionTrustRefused('PHP 8.4.27 or newer on the 8.4 line is required.');
if (PHP_MAJOR_VERSION !== 8 || PHP_MINOR_VERSION !== 4 || PHP_VERSION_ID < 80428) {
throw new ProductionTrustRefused('PHP 8.4.28 or newer on the 8.4 line is required.');
}
Phar::loadPhar($argv[1]);
require_once 'phar://composer.phar/vendor/autoload.php';
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/php-container-images.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"8.4": "php:8.4.27-cli-bookworm@sha256:b3e907a1108629c562c4bb313ce3449e34d49991f6bb2487913f6146f47200fe",
"8.5": "php:8.5.12-cli-bookworm@sha256:050713ce008e2360ea9dc96e1f9a075690132388d917fc3552806f7a7be6f2a0"
"8.4": "php:8.4.28-cli-bookworm@sha256:85da896b3eeb8bcd83fe612e51a529b7d5983a1fab92ef5f63c7ac6e2842fc46",
"8.5": "php:8.5.13-cli-bookworm@sha256:d6991172c4282d2a09d6418073923a81664173bb0a0e07a16663a9a645746092"
}
2 changes: 1 addition & 1 deletion tests/Unit/ProductionImageTrustContractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function test_external_runtime_and_composer_inputs_are_immutable(): void
}
$this->assertStringContainsString('node:22.23.4-bookworm-slim@', $source);
$this->assertStringContainsString('composer:2.11.0@', $source);
$this->assertStringContainsString('php:8.4.27-cli-bookworm@', $source);
$this->assertStringContainsString('php:8.4.28-cli-bookworm@', $source);
}

public function test_node_is_checked_before_asset_and_final_browser_downloads(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/ci/test_bookworm_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
CONTEXT_SOURCE = ".central-apt-source/docker/apt/require-fixed-bookworm-apt.sh"
GUARD_PATH = "/usr/local/share/sample-app/require-fixed-bookworm-apt.sh"
GUARD = "/bin/sh " + GUARD_PATH
PARENT = "php:8.4.27-cli-bookworm@sha256:b3e907a1108629c562c4bb313ce3449e34d49991f6bb2487913f6146f47200fe"
PARENT = "php:8.4.28-cli-bookworm@sha256:85da896b3eeb8bcd83fe612e51a529b7d5983a1fab92ef5f63c7ac6e2842fc46"


def instructions(source):
Expand Down
6 changes: 3 additions & 3 deletions tests/ci/test_devcontainer_attestations.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def bundle(platform="linux/amd64", change=None):
metadata = {"vcs": {"source": "https://github.com/durable-workflow/sample-app",
"revision": REVISION, "localdir:dockerfile": ".devcontainer/docker"},
"source": {"infos": [{"filename": "Dockerfile", "language": "Dockerfile",
"data": base64.b64encode(f"FROM php:8.4.27-cli-bookworm@{BASE}\n".encode()).decode()}]}}
"data": base64.b64encode(f"FROM php:8.4.28-cli-bookworm@{BASE}\n".encode()).decode()}]}}
provenance = {"runDetails": {"metadata": {"buildkit_metadata": metadata}},
"buildDefinition": {"resolvedDependencies": [
{"uri": f"pkg:docker/[email protected].27-cli-bookworm?digest={BASE}&platform={platform}",
{"uri": f"pkg:docker/[email protected].28-cli-bookworm?digest={BASE}&platform={platform}",
"digest": {"sha256": BASE[7:]}}]}}

def statement(kind, predicate):
Expand Down Expand Up @@ -134,7 +134,7 @@ def change(values):
self.verify(change)

def test_mutable_or_other_distribution_base_is_refused(self):
for base in ("php:8.4.27-cli-bookworm", "php:8.4.27-cli-trixie@" + BASE):
for base in ("php:8.4.28-cli-bookworm", "php:8.4.28-cli-trixie@" + BASE):
def change(values):
info = values[VERIFIER.SLSA]["predicate"]["runDetails"]["metadata"]["buildkit_metadata"]["source"]["infos"][0]
info["data"] = base64.b64encode(f"FROM {base}\n".encode()).decode()
Expand Down