Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

composer 2.5.0 #13773

Merged
merged 3 commits into from
Dec 22, 2022
Merged

composer 2.5.0 #13773

merged 3 commits into from
Dec 22, 2022

Conversation

alcohol
Copy link
Contributor

@alcohol alcohol commented Dec 20, 2022

No description provided.

@yosifkit
Copy link
Member

Docker's classic builder (docker build as in 20.10.x) will still create the extra untagged images, even though they are unused by the build. The newer builder, buildkit, does skip it appropriately. We've recently added support for specifying the newer builder (docker-library/bashbrew#43). So this will need Builder: buildkit added to the Library file like rabbitmq.

@alcohol
Copy link
Contributor Author

alcohol commented Dec 22, 2022

To be honest, I am not sure what extra untagged images you are referring to. But looking at the change made for rabbitmq; if that is all that is desired, I'll serve that up in a minute.

@github-actions
Copy link

Diff for 8638057:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 8f84fc2..d2af9f7 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,26 +1,33 @@
 Maintainers: Composer (@composer), Rob Bast (@alcohol)
 GitRepo: https://github.com/composer/docker.git
+Builder: buildkit
 
 Tags: 1.10.26, 1.10, 1
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
 GitFetch: refs/heads/main
-GitCommit: 8dff639787c5813b916cd43c1543a6e987f1115b
+GitCommit: 88e63fbab43e2151b0743a4c6d18a9c59aa9db0c
 Directory: 1.10
 
-Tags: 2.2.18, 2.2
+Tags: 2.2.18, 2.2, lts
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
 GitFetch: refs/heads/main
-GitCommit: aac1ec40922d76283547e15dfb5aac82802a24d4
+GitCommit: 88e63fbab43e2151b0743a4c6d18a9c59aa9db0c
 Directory: 2.2
 
 Tags: 2.3.10, 2.3
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
 GitFetch: refs/heads/main
-GitCommit: f330335b9cf25f09b0870a7556c79cf62b018953
+GitCommit: 88e63fbab43e2151b0743a4c6d18a9c59aa9db0c
 Directory: 2.3
 
-Tags: 2.4.4, 2.4, 2, latest
+Tags: 2.4.4, 2.4
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
 GitFetch: refs/heads/main
-GitCommit: 9f1f0e2f42f8a525b4b0ba3b2f33429fae7d07bf
+GitCommit: 88e63fbab43e2151b0743a4c6d18a9c59aa9db0c
 Directory: 2.4
+
+Tags: 2.5.0, 2.5, 2, latest
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
+GitFetch: refs/heads/main
+GitCommit: 8893af83206c700d88fee60afb69d2281d39b827
+Directory: 2.5
diff --git a/_bashbrew-list b/_bashbrew-list
index 5fce38a..e08a7f1 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -8,4 +8,7 @@ composer:2.3
 composer:2.3.10
 composer:2.4
 composer:2.4.4
+composer:2.5
+composer:2.5.0
 composer:latest
+composer:lts
diff --git a/_bashbrew-list-build-order b/_bashbrew-list-build-order
index fa14be8..275f15e 100644
--- a/_bashbrew-list-build-order
+++ b/_bashbrew-list-build-order
@@ -1,4 +1,5 @@
 composer:1
-composer:2.2
+composer:lts
 composer:2.3
+composer:2.4
 composer:latest
diff --git a/composer_1/Dockerfile b/composer_1/Dockerfile
index bbcde98..0ca221f 100644
--- a/composer_1/Dockerfile
+++ b/composer_1/Dockerfile
@@ -1,4 +1,4 @@
-FROM php:8-alpine
+FROM php:8-alpine AS binary-with-runtime
 
 RUN set -eux ; \
   apk add --no-cache --virtual .composer-rundeps \
@@ -89,3 +89,10 @@ WORKDIR /app
 ENTRYPOINT ["/docker-entrypoint.sh"]
 
 CMD ["composer"]
+
+FROM scratch AS standalone-binary
+
+COPY --from=binary-with-runtime /usr/bin/composer /composer
+
+# This is defined as last target to be backward compatible with build without explicit --target option
+FROM binary-with-runtime AS default
diff --git a/composer_2.3/Dockerfile b/composer_2.3/Dockerfile
index be79e18..d74174b 100644
--- a/composer_2.3/Dockerfile
+++ b/composer_2.3/Dockerfile
@@ -1,4 +1,4 @@
-FROM php:8-alpine
+FROM php:8-alpine AS binary-with-runtime
 
 RUN set -eux ; \
   apk add --no-cache --virtual .composer-rundeps \
@@ -89,3 +89,10 @@ WORKDIR /app
 ENTRYPOINT ["/docker-entrypoint.sh"]
 
 CMD ["composer"]
+
+FROM scratch AS standalone-binary
+
+COPY --from=binary-with-runtime /usr/bin/composer /composer
+
+# This is defined as last target to be backward compatible with build without explicit --target option
+FROM binary-with-runtime AS default
diff --git a/composer_latest/Dockerfile b/composer_2.4/Dockerfile
similarity index 91%
copy from composer_latest/Dockerfile
copy to composer_2.4/Dockerfile
index c0b4ca7..866be1c 100644
--- a/composer_latest/Dockerfile
+++ b/composer_2.4/Dockerfile
@@ -1,4 +1,4 @@
-FROM php:8-alpine
+FROM php:8-alpine AS binary-with-runtime
 
 RUN set -eux ; \
   apk add --no-cache --virtual .composer-rundeps \
@@ -89,3 +89,10 @@ WORKDIR /app
 ENTRYPOINT ["/docker-entrypoint.sh"]
 
 CMD ["composer"]
+
+FROM scratch AS standalone-binary
+
+COPY --from=binary-with-runtime /usr/bin/composer /composer
+
+# This is defined as last target to be backward compatible with build without explicit --target option
+FROM binary-with-runtime AS default
diff --git a/composer_2.2/docker-entrypoint.sh b/composer_2.4/docker-entrypoint.sh
similarity index 100%
copy from composer_2.2/docker-entrypoint.sh
copy to composer_2.4/docker-entrypoint.sh
diff --git a/composer_latest/Dockerfile b/composer_latest/Dockerfile
index c0b4ca7..ba1dfae 100644
--- a/composer_latest/Dockerfile
+++ b/composer_latest/Dockerfile
@@ -1,4 +1,4 @@
-FROM php:8-alpine
+FROM php:8-alpine AS binary-with-runtime
 
 RUN set -eux ; \
   apk add --no-cache --virtual .composer-rundeps \
@@ -22,7 +22,7 @@ memory_limit=-1\n\
 
 ENV COMPOSER_ALLOW_SUPERUSER 1
 ENV COMPOSER_HOME /tmp
-ENV COMPOSER_VERSION 2.4.4
+ENV COMPOSER_VERSION 2.5.0
 
 RUN set -eux ; \
   # install https://github.com/mlocati/docker-php-extension-installer
@@ -89,3 +89,10 @@ WORKDIR /app
 ENTRYPOINT ["/docker-entrypoint.sh"]
 
 CMD ["composer"]
+
+FROM scratch AS standalone-binary
+
+COPY --from=binary-with-runtime /usr/bin/composer /composer
+
+# This is defined as last target to be backward compatible with build without explicit --target option
+FROM binary-with-runtime AS default
diff --git a/composer_2.2/Dockerfile b/composer_lts/Dockerfile
similarity index 91%
rename from composer_2.2/Dockerfile
rename to composer_lts/Dockerfile
index 644c21d..1fdea40 100644
--- a/composer_2.2/Dockerfile
+++ b/composer_lts/Dockerfile
@@ -1,4 +1,4 @@
-FROM php:8-alpine
+FROM php:8-alpine AS binary-with-runtime
 
 RUN set -eux ; \
   apk add --no-cache --virtual .composer-rundeps \
@@ -89,3 +89,10 @@ WORKDIR /app
 ENTRYPOINT ["/docker-entrypoint.sh"]
 
 CMD ["composer"]
+
+FROM scratch AS standalone-binary
+
+COPY --from=binary-with-runtime /usr/bin/composer /composer
+
+# This is defined as last target to be backward compatible with build without explicit --target option
+FROM binary-with-runtime AS default
diff --git a/composer_2.2/docker-entrypoint.sh b/composer_lts/docker-entrypoint.sh
similarity index 100%
rename from composer_2.2/docker-entrypoint.sh
rename to composer_lts/docker-entrypoint.sh

Relevant Maintainers:

@tianon
Copy link
Member

tianon commented Dec 22, 2022

He means that the classic builder will build the standalone-binary stage whether it needs to or not, so without switching to BuildKit that'll result in fresh "dangling" images being built every time we build this repo (we do plan to switch everyone to BuildKit by default eventually, but it's a pretty dramatic change so we're trying to take it slow given the level of impact if anything goes wrong).

@tianon tianon merged commit a962a8a into docker-library:master Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants