diff --git a/.github/workflows/latest.yaml b/.github/workflows/latest.yaml new file mode 100644 index 0000000..584678d --- /dev/null +++ b/.github/workflows/latest.yaml @@ -0,0 +1,252 @@ +name: Latest + +on: + pull_request: + paths: + - .github/workflows/latest.yaml + - latest/** + push: + branches: + - main + paths: + - .github/workflows/latest.yaml + - latest/** + +env: + AWS_REGION: us-east-1 + DOCKERHUB_SLUG: composer/composer + ECR_SLUG: public.ecr.aws/u0u1j5s3/composer + GHCR_SLUG: ghcr.io/composer/docker + DIRECTORY: latest + +jobs: + + prepare: + + runs-on: ubuntu-latest + + outputs: + full-annotations: ${{ steps.meta-full.outputs.annotations }} + full-labels: ${{ steps.meta-full.outputs.labels }} + full-json: ${{ steps.meta-full.outputs.json }} + bin-annotations: ${{ steps.meta-bin.outputs.annotations }} + bin-labels: ${{ steps.meta-bin.outputs.labels }} + bin-json: ${{ steps.meta-bin.outputs.json }} + + steps: + + - name: Checkout + uses: actions/checkout@v4 + + - name: Determine Composer version from Dockerfile + uses: ./.github/actions/determine-composer-version + with: + working-directory: ${{ env.DIRECTORY }} + + - name: Docker metadata (full image) + id: meta-full + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.DOCKERHUB_SLUG }} + ${{ env.ECR_SLUG }} + ${{ env.GHCR_SLUG }} + flavor: | + latest=false + tags: | + type=semver,pattern={{version}},value=${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} + type=semver,pattern={{major}}.{{minor}},value=${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} + latest + labels: | + org.opencontainers.image.vendor=Composer + org.opencontainers.image.title=Composer + org.opencontainers.image.description=PHP runtime image with Composer + + - name: Docker metadata (binary-only image) + id: meta-bin + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.DOCKERHUB_SLUG }} + ${{ env.ECR_SLUG }} + ${{ env.GHCR_SLUG }} + flavor: | + latest=false + suffix=-bin + tags: | + type=semver,pattern={{version}},value=${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} + type=semver,pattern={{major}}.{{minor}},value=${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} + latest + labels: | + org.opencontainers.image.vendor=Composer + org.opencontainers.image.title=Composer + org.opencontainers.image.description=Image with Composer binary only + + build: + + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: + - prepare + + strategy: + matrix: + platform: + - linux/amd64 + - linux/arm/v6 + - linux/arm/v7 + - linux/arm64/v8 + - linux/i386 + - linux/ppc64le + - linux/riscv64 + - linux/s390x + + defaults: + run: + working-directory: ${{ env.DIRECTORY }} + + steps: + + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_SLUG=${platform//\//-}" >> $GITHUB_ENV + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: ${{ matrix.platform }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to Amazon Public ECR + #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: public.ecr.aws + username: ${{ secrets.AWS_ECR_ACCESS_KEY }} + password: ${{ secrets.AWS_ECR_SECRET_KEY }} + + - name: Login to Github Container Registry + #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build full image + id: build-full + uses: docker/build-push-action@v5 + with: + context: ${{ env.DIRECTORY }} + target: binary-with-runtime + annotations: ${{ needs.prepare.outputs.full-annotations }} + platforms: ${{ matrix.platform }} + outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=true #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + + - name: Build binary-only image + id: build-bin + uses: docker/build-push-action@v5 + with: + context: ${{ env.DIRECTORY }} + target: standalone-binary + annotations: ${{ needs.prepare.outputs.bin-annotations }} + platforms: ${{ matrix.platform }} + outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=true #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + + - name: Export digests + run: | + mkdir -p /tmp/digests/{full,bin} + digest="${{ steps.build-full.outputs.digest }}" + touch "/tmp/digests/full/${digest#sha256:}" + digest="${{ steps.build-bin.outputs.digest }}" + touch "/tmp/digests/bin/${digest#sha256:}" + + - name: Upload digests + uses: actions/upload-artifact@v4 + with: + name: digests-${{ env.PLATFORM_SLUG }} + path: | + /tmp/digests/full/* + /tmp/digests/bin/* + if-no-files-found: error + retention-days: 1 + + merge: + + #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + + runs-on: ubuntu-latest + + needs: + - prepare + - build + + steps: + + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to Amazon Public ECR + uses: docker/login-action@v3 + with: + registry: public.ecr.aws + username: ${{ secrets.AWS_ECR_ACCESS_KEY }} + password: ${{ secrets.AWS_ECR_SECRET_KEY }} + + - name: Login to Github Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list for full image and push + working-directory: /tmp/digests/full + env: + JSON: ${{ needs.prepare.outputs.full-json }} + run: | + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.DOCKERHUB_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.DOCKERHUB_SLUG }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.ECR_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.ECR_SLUG }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.GHCR_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.GHCR_SLUG }}@sha256:%s ' *) + + - name: Create manifest list for binary-only image and push + working-directory: /tmp/digests/bin + env: + JSON: ${{ needs.prepare.outputs.bin-json }} + run: | + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.DOCKERHUB_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.DOCKERHUB_SLUG }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.ECR_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.ECR_SLUG }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.GHCR_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.GHCR_SLUG }}@sha256:%s ' *) diff --git a/.github/workflows/legacy.yaml b/.github/workflows/legacy.yaml new file mode 100644 index 0000000..5cc1daa --- /dev/null +++ b/.github/workflows/legacy.yaml @@ -0,0 +1,252 @@ +name: Legacy + +on: + pull_request: + paths: + - .github/workflows/latest.yaml + - legacy/** + push: + branches: + - main + paths: + - .github/workflows/latest.yaml + - legacy/** + +env: + AWS_REGION: us-east-1 + DOCKERHUB_SLUG: composer/composer + ECR_SLUG: public.ecr.aws/u0u1j5s3/composer + GHCR_SLUG: ghcr.io/composer/docker + DIRECTORY: legacy + +jobs: + + prepare: + + runs-on: ubuntu-latest + + outputs: + full-annotations: ${{ steps.meta-full.outputs.annotations }} + full-labels: ${{ steps.meta-full.outputs.labels }} + full-json: ${{ steps.meta-full.outputs.json }} + bin-annotations: ${{ steps.meta-bin.outputs.annotations }} + bin-labels: ${{ steps.meta-bin.outputs.labels }} + bin-json: ${{ steps.meta-bin.outputs.json }} + + steps: + + - name: Checkout + uses: actions/checkout@v4 + + - name: Determine Composer version from Dockerfile + uses: ./.github/actions/determine-composer-version + with: + working-directory: ${{ env.DIRECTORY }} + + - name: Docker metadata (full image) + id: meta-full + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.DOCKERHUB_SLUG }} + ${{ env.ECR_SLUG }} + ${{ env.GHCR_SLUG }} + flavor: | + latest=false + tags: | + type=semver,pattern={{version}},value=${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} + type=semver,pattern={{major}}.{{minor}},value=${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} + type=semver,pattern={{major}},value=${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} + labels: | + org.opencontainers.image.vendor=Composer + org.opencontainers.image.title=Composer + org.opencontainers.image.description=PHP runtime image with Composer + + - name: Docker metadata (binary-only image) + id: meta-bin + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.DOCKERHUB_SLUG }} + ${{ env.ECR_SLUG }} + ${{ env.GHCR_SLUG }} + flavor: | + latest=false + suffix=-bin + tags: | + type=semver,pattern={{version}},value=${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} + type=semver,pattern={{major}}.{{minor}},value=${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} + type=semver,pattern={{major}},value=${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} + labels: | + org.opencontainers.image.vendor=Composer + org.opencontainers.image.title=Composer + org.opencontainers.image.description=Image with Composer binary only + + build: + + runs-on: ubuntu-latest + timeout-minutes: 20 + + needs: + - prepare + + strategy: + matrix: + platform: + - linux/amd64 + - linux/arm/v6 + - linux/arm/v7 + - linux/arm64/v8 + - linux/i386 + - linux/ppc64le + - linux/riscv64 + - linux/s390x + + defaults: + run: + working-directory: ${{ env.DIRECTORY }} + + steps: + + - name: Checkout + uses: actions/checkout@v4 + + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_SLUG=${platform//\//-}" >> $GITHUB_ENV + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: ${{ matrix.platform }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to Amazon Public ECR + #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: public.ecr.aws + username: ${{ secrets.AWS_ECR_ACCESS_KEY }} + password: ${{ secrets.AWS_ECR_SECRET_KEY }} + + - name: Login to Github Container Registry + #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build full image + id: build-full + uses: docker/build-push-action@v5 + with: + context: ${{ env.DIRECTORY }} + target: binary-with-runtime + annotations: ${{ needs.prepare.outputs.full-annotations }} + platforms: ${{ matrix.platform }} + outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=true #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + + - name: Build binary-only image + id: build-bin + uses: docker/build-push-action@v5 + with: + context: ${{ env.DIRECTORY }} + target: standalone-binary + annotations: ${{ needs.prepare.outputs.bin-annotations }} + platforms: ${{ matrix.platform }} + outputs: type=image,"name=${{ env.DOCKERHUB_SLUG }},${{ env.ECR_SLUG }},${{ env.GHCR_SLUG }}",push-by-digest=true,name-canonical=true,push=true #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + + - name: Export digests + run: | + mkdir -p /tmp/digests/{full,bin} + digest="${{ steps.build-full.outputs.digest }}" + touch "/tmp/digests/full/${digest#sha256:}" + digest="${{ steps.build-bin.outputs.digest }}" + touch "/tmp/digests/bin/${digest#sha256:}" + + - name: Upload digests + uses: actions/upload-artifact@v4 + with: + name: digests-${{ env.PLATFORM_SLUG }} + path: | + /tmp/digests/full/* + /tmp/digests/bin/* + if-no-files-found: error + retention-days: 1 + + merge: + + #if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + + runs-on: ubuntu-latest + + needs: + - prepare + - build + + steps: + + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Login to Amazon Public ECR + uses: docker/login-action@v3 + with: + registry: public.ecr.aws + username: ${{ secrets.AWS_ECR_ACCESS_KEY }} + password: ${{ secrets.AWS_ECR_SECRET_KEY }} + + - name: Login to Github Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list for full image and push + working-directory: /tmp/digests/full + env: + JSON: ${{ needs.prepare.outputs.full-json }} + run: | + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.DOCKERHUB_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.DOCKERHUB_SLUG }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.ECR_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.ECR_SLUG }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.GHCR_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.GHCR_SLUG }}@sha256:%s ' *) + + - name: Create manifest list for binary-only image and push + working-directory: /tmp/digests/bin + env: + JSON: ${{ needs.prepare.outputs.bin-json }} + run: | + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.DOCKERHUB_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.DOCKERHUB_SLUG }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.ECR_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.ECR_SLUG }}@sha256:%s ' *) + docker buildx imagetools create $(jq -cr '.tags | map(select(startswith("${{ env.GHCR_SLUG }}")) | "--tag " + .) | join(" ")' <<< "$JSON") \ + $(printf '${{ env.GHCR_SLUG }}@sha256:%s ' *) diff --git a/.github/workflows/v2-lts.yaml b/.github/workflows/lts.yaml similarity index 98% rename from .github/workflows/v2-lts.yaml rename to .github/workflows/lts.yaml index c041c11..8409dbb 100644 --- a/.github/workflows/v2-lts.yaml +++ b/.github/workflows/lts.yaml @@ -1,23 +1,23 @@ -name: Docker - v2 LTS +name: LTS (Long Term Support) on: pull_request: paths: - - .github/workflows/v2-lts.yaml - - '2.2/**' + - .github/workflows/lts.yaml + - lts/** push: branches: - main paths: - - .github/workflows/v2-lts.yaml - - '2.2/**' + - .github/workflows/lts.yaml + - lts/** env: AWS_REGION: us-east-1 DOCKERHUB_SLUG: composer/composer ECR_SLUG: public.ecr.aws/u0u1j5s3/composer GHCR_SLUG: ghcr.io/composer/docker - DIRECTORY: 2.2 + DIRECTORY: lts jobs: diff --git a/.github/workflows/v1.yaml b/.github/workflows/v1.yaml deleted file mode 100644 index 3ef390b..0000000 --- a/.github/workflows/v1.yaml +++ /dev/null @@ -1,96 +0,0 @@ -name: Docker - v1 - -on: - pull_request: - paths: - - .github/workflows/v1.yaml - - '1.10/**' - push: - branches: - - main - paths: - - .github/workflows/v1.yaml - - '1.10/**' - -env: - AWS_REGION: us-east-1 - ECR_REPO: public.ecr.aws/u0u1j5s3/composer - -jobs: - build: - name: Build EOL version - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - matrix: - version: - - "1.10" - steps: - - uses: actions/checkout@v4 - - name: "Determine composer version from Dockerfile" - uses: "./.github/actions/determine-composer-version" - with: - working-directory: "${{ matrix.version }}" - # Build full image: binary with runtime - - name: Build full image - working-directory: ${{ matrix.version }} - run: | - docker build \ - --pull \ - --no-cache \ - --target binary-with-runtime \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR }} \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} \ - . - # Build low-size image with binary only - - name: Build binary-only image - working-directory: ${{ matrix.version }} - run: | - docker build \ - --pull \ - --no-cache \ - --target standalone-binary \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR }}-bin \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin \ - . - - name: Login to Docker Hub - if: github.ref == 'refs/heads/main' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Push tag(s) to Docker Hub - if: github.ref == 'refs/heads/main' - working-directory: ${{ matrix.version }} - run: | - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR }} - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR }}-bin - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin - - name: Login to Amazon Public ECR - if: github.ref == 'refs/heads/main' - uses: docker/login-action@v3 - with: - registry: public.ecr.aws - username: ${{ secrets.AWS_ECR_ACCESS_KEY }} - password: ${{ secrets.AWS_ECR_SECRET_KEY }} - - name: Push tag(s) to Amazon Public ECR - if: github.ref == 'refs/heads/main' - working-directory: ${{ matrix.version }} - run: | - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR }} ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR }} - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR }}-bin ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR }}-bin - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR }} - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR }}-bin - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin diff --git a/.github/workflows/v2-current.yaml b/.github/workflows/v2-current.yaml deleted file mode 100644 index eb1bb84..0000000 --- a/.github/workflows/v2-current.yaml +++ /dev/null @@ -1,104 +0,0 @@ -name: Docker - v2 current - -on: - pull_request: - paths: - - .github/workflows/v2-current.yaml - - '2.7/**' - push: - branches: - - main - paths: - - .github/workflows/v2-current.yaml - - '2.7/**' - -env: - AWS_REGION: us-east-1 - ECR_REPO: public.ecr.aws/u0u1j5s3/composer - -jobs: - build-latest: - name: Build latest version - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - matrix: - version: - - "2.7" - steps: - - uses: actions/checkout@v4 - - name: "Determine composer version from Dockerfile" - uses: "./.github/actions/determine-composer-version" - with: - working-directory: "${{ matrix.version }}" - # Build full image: binary with runtime - - name: Build full image - working-directory: ${{ matrix.version }} - run: | - docker build \ - --pull \ - --no-cache \ - --target binary-with-runtime \ - --tag composer/composer:latest \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR }} \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} \ - . - # Build low-size image with binary only - - name: Build binary-only image - working-directory: ${{ matrix.version }} - run: | - docker build \ - --pull \ - --no-cache \ - --target standalone-binary \ - --tag composer/composer:latest-bin \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR }}-bin \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin \ - . - - name: Login to Docker Hub - if: github.ref == 'refs/heads/main' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Push tag(s) to Docker Hub - if: github.ref == 'refs/heads/main' - working-directory: ${{ matrix.version }} - run: | - docker push composer/composer:latest - docker push composer/composer:latest-bin - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR }} - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR }}-bin - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin - - name: Login to Amazon Public ECR - if: github.ref == 'refs/heads/main' - uses: docker/login-action@v3 - with: - registry: public.ecr.aws - username: ${{ secrets.AWS_ECR_ACCESS_KEY }} - password: ${{ secrets.AWS_ECR_SECRET_KEY }} - - name: Push tag(s) to Amazon Public ECR - if: github.ref == 'refs/heads/main' - working-directory: ${{ matrix.version }} - run: | - docker tag composer/composer:latest ${{ env.ECR_REPO }}:latest - docker tag composer/composer:latest-bin ${{ env.ECR_REPO }}:latest-bin - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR }} ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR }} - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR }}-bin ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR }}-bin - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin - docker push ${{ env.ECR_REPO }}:latest - docker push ${{ env.ECR_REPO }}:latest-bin - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR }} - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR }}-bin - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin diff --git a/.github/workflows/v2-previous.yaml b/.github/workflows/v2-previous.yaml deleted file mode 100644 index 25cccaf..0000000 --- a/.github/workflows/v2-previous.yaml +++ /dev/null @@ -1,98 +0,0 @@ -name: Docker - v2 previous - -on: - pull_request: - paths: - - .github/workflows/v2-previous.yaml - - '2.3/**' - - '2.4/**' - - '2.5/**' - - '2.6/**' - push: - branches: - - main - paths: - - .github/workflows/v2-previous.yaml - - '2.3/**' - - '2.4/**' - - '2.5/**' - - '2.6/**' - -env: - AWS_REGION: us-east-1 - ECR_REPO: public.ecr.aws/u0u1j5s3/composer - -jobs: - build-previous: - name: Build previous versions - runs-on: ubuntu-latest - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - version: - - "2.3" - - "2.4" - - "2.5" - - "2.6" - steps: - - uses: actions/checkout@v4 - - name: "Determine composer version from Dockerfile" - uses: "./.github/actions/determine-composer-version" - with: - working-directory: "${{ matrix.version }}" - # Build full image: binary with runtime - - name: Build full image - working-directory: ${{ matrix.version }} - run: | - docker build \ - --pull \ - --no-cache \ - --target binary-with-runtime \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} \ - . - # Build low-size image with binary only - - name: Build binary-only image - working-directory: ${{ matrix.version }} - run: | - docker build \ - --pull \ - --no-cache \ - --target standalone-binary \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin \ - --tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin \ - . - - name: Login to Docker Hub - if: github.ref == 'refs/heads/main' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Push tag(s) to Docker Hub - if: github.ref == 'refs/heads/main' - working-directory: ${{ matrix.version }} - run: | - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} - docker push composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin - - name: Login to Amazon Public ECR - if: github.ref == 'refs/heads/main' - uses: docker/login-action@v3 - with: - registry: public.ecr.aws - username: ${{ secrets.AWS_ECR_ACCESS_KEY }} - password: ${{ secrets.AWS_ECR_SECRET_KEY }} - - name: Push tag(s) to Amazon Public ECR - if: github.ref == 'refs/heads/main' - working-directory: ${{ matrix.version }} - run: | - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} - docker tag composer/composer:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }} - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR }}-bin - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }} - docker push ${{ env.ECR_REPO }}:${{ env.COMPOSER_VERSION_MAJOR_MINOR_PATCH }}-bin diff --git a/2.3/Dockerfile b/2.3/Dockerfile deleted file mode 100644 index d74174b..0000000 --- a/2.3/Dockerfile +++ /dev/null @@ -1,98 +0,0 @@ -FROM php:8-alpine AS binary-with-runtime - -RUN set -eux ; \ - apk add --no-cache --virtual .composer-rundeps \ - bash \ - coreutils \ - git \ - make \ - openssh-client \ - patch \ - subversion \ - tini \ - unzip \ - zip \ - $([ "$(apk --print-arch)" != "x86" ] && echo mercurial) \ - $([ "$(apk --print-arch)" != "armhf" ] && echo p7zip) - -RUN printf "# composer php cli ini settings\n\ -date.timezone=UTC\n\ -memory_limit=-1\n\ -" > $PHP_INI_DIR/php-cli.ini - -ENV COMPOSER_ALLOW_SUPERUSER 1 -ENV COMPOSER_HOME /tmp -ENV COMPOSER_VERSION 2.3.10 - -RUN set -eux ; \ - # install https://github.com/mlocati/docker-php-extension-installer - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /usr/local/bin/install-php-extensions \ - --url https://github.com/mlocati/docker-php-extension-installer/releases/download/1.2.58/install-php-extensions \ - ; \ - echo 182011b3dca5544a70fdeb587af44ed1760aa9a2ed37d787d0f280a99f92b008e638c37762360cd85583830a097665547849cb2293c4a0ee32c2a36ef7a349e2 /usr/local/bin/install-php-extensions | sha512sum --strict --check ; \ - chmod +x /usr/local/bin/install-php-extensions ; \ - # install necessary/useful extensions not included in base image - install-php-extensions \ - bz2 \ - zip \ - ; \ - # install public keys for snapshot and tag validation, see https://composer.github.io/pubkeys.html - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/keys.dev.pub \ - --url https://github.com/raw/composer/composer.github.io/e7f28b7200249f8e5bc912b42837d4598c74153a/snapshots.pub \ - ; \ - echo 572b963c4b7512a7de3c71a788772440b1996d918b1d2b5354bf8ba2bb057fadec6f7ac4852f2f8a8c01ab94c18141ce0422aec3619354b057216e0597db5ac2 /tmp/keys.dev.pub | sha512sum --strict --check ; \ - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/keys.tags.pub \ - --url https://github.com/raw/composer/composer.github.io/e7f28b7200249f8e5bc912b42837d4598c74153a/releases.pub \ - ; \ - echo 47f374b8840dcb0aa7b2327f13d24ab5f6ae9e58aa630af0d62b3d0ea114f4a315c5d97b21dcad3c7ffe2f0a95db2edec267adaba3f4f5a262abebe39aed3a28 /tmp/keys.tags.pub | sha512sum --strict --check ; \ - # download installer.php, see https://getcomposer.org/download/ - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/installer.php \ - --url https://github.com/raw/composer/getcomposer.org/f24b8f860b95b52167f91bbd3e3a7bcafe043038/web/installer \ - ; \ - echo 3137ad86bd990524ba1dedc2038309dfa6b63790d3ca52c28afea65dcc2eaead16fb33e9a72fd2a7a8240afaf26e065939a2d472f3b0eeaa575d1e8648f9bf19 /tmp/installer.php | sha512sum --strict --check ; \ - # install composer phar binary - php /tmp/installer.php \ - --no-ansi \ - --install-dir=/usr/bin \ - --filename=composer \ - --version=${COMPOSER_VERSION} \ - ; \ - composer --ansi --version --no-interaction ; \ - composer diagnose ; \ - rm -f /tmp/installer.php ; \ - find /tmp -type d -exec chmod -v 1777 {} + - -COPY docker-entrypoint.sh /docker-entrypoint.sh - -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/2.4/Dockerfile b/2.4/Dockerfile deleted file mode 100644 index 866be1c..0000000 --- a/2.4/Dockerfile +++ /dev/null @@ -1,98 +0,0 @@ -FROM php:8-alpine AS binary-with-runtime - -RUN set -eux ; \ - apk add --no-cache --virtual .composer-rundeps \ - bash \ - coreutils \ - git \ - make \ - openssh-client \ - patch \ - subversion \ - tini \ - unzip \ - zip \ - $([ "$(apk --print-arch)" != "x86" ] && echo mercurial) \ - $([ "$(apk --print-arch)" != "armhf" ] && echo p7zip) - -RUN printf "# composer php cli ini settings\n\ -date.timezone=UTC\n\ -memory_limit=-1\n\ -" > $PHP_INI_DIR/php-cli.ini - -ENV COMPOSER_ALLOW_SUPERUSER 1 -ENV COMPOSER_HOME /tmp -ENV COMPOSER_VERSION 2.4.4 - -RUN set -eux ; \ - # install https://github.com/mlocati/docker-php-extension-installer - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /usr/local/bin/install-php-extensions \ - --url https://github.com/mlocati/docker-php-extension-installer/releases/download/1.2.58/install-php-extensions \ - ; \ - echo 182011b3dca5544a70fdeb587af44ed1760aa9a2ed37d787d0f280a99f92b008e638c37762360cd85583830a097665547849cb2293c4a0ee32c2a36ef7a349e2 /usr/local/bin/install-php-extensions | sha512sum --strict --check ; \ - chmod +x /usr/local/bin/install-php-extensions ; \ - # install necessary/useful extensions not included in base image - install-php-extensions \ - bz2 \ - zip \ - ; \ - # install public keys for snapshot and tag validation, see https://composer.github.io/pubkeys.html - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/keys.dev.pub \ - --url https://github.com/raw/composer/composer.github.io/e7f28b7200249f8e5bc912b42837d4598c74153a/snapshots.pub \ - ; \ - echo 572b963c4b7512a7de3c71a788772440b1996d918b1d2b5354bf8ba2bb057fadec6f7ac4852f2f8a8c01ab94c18141ce0422aec3619354b057216e0597db5ac2 /tmp/keys.dev.pub | sha512sum --strict --check ; \ - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/keys.tags.pub \ - --url https://github.com/raw/composer/composer.github.io/e7f28b7200249f8e5bc912b42837d4598c74153a/releases.pub \ - ; \ - echo 47f374b8840dcb0aa7b2327f13d24ab5f6ae9e58aa630af0d62b3d0ea114f4a315c5d97b21dcad3c7ffe2f0a95db2edec267adaba3f4f5a262abebe39aed3a28 /tmp/keys.tags.pub | sha512sum --strict --check ; \ - # download installer.php, see https://getcomposer.org/download/ - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/installer.php \ - --url https://github.com/raw/composer/getcomposer.org/f24b8f860b95b52167f91bbd3e3a7bcafe043038/web/installer \ - ; \ - echo 3137ad86bd990524ba1dedc2038309dfa6b63790d3ca52c28afea65dcc2eaead16fb33e9a72fd2a7a8240afaf26e065939a2d472f3b0eeaa575d1e8648f9bf19 /tmp/installer.php | sha512sum --strict --check ; \ - # install composer phar binary - php /tmp/installer.php \ - --no-ansi \ - --install-dir=/usr/bin \ - --filename=composer \ - --version=${COMPOSER_VERSION} \ - ; \ - composer --ansi --version --no-interaction ; \ - composer diagnose ; \ - rm -f /tmp/installer.php ; \ - find /tmp -type d -exec chmod -v 1777 {} + - -COPY docker-entrypoint.sh /docker-entrypoint.sh - -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/2.4/docker-entrypoint.sh b/2.4/docker-entrypoint.sh deleted file mode 100755 index dfb5f49..0000000 --- a/2.4/docker-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -isCommand() { - # Retain backwards compatibility with common CI providers, - # see: https://github.com/composer/docker/issues/107 - if [ "$1" = "sh" ]; then - return 1 - fi - - composer help --no-interaction "$1" > /dev/null 2>&1 -} - -# check if the first argument passed in looks like a flag -if [ "${1#-}" != "$1" ]; then - set -- /sbin/tini -- composer "$@" -# check if the first argument passed in is composer -elif [ "$1" = 'composer' ]; then - set -- /sbin/tini -- "$@" -# check if the first argument passed in matches a known command -elif isCommand "$1"; then - set -- /sbin/tini -- composer "$@" -fi - -exec "$@" diff --git a/2.5/Dockerfile b/2.5/Dockerfile deleted file mode 100644 index 09da5fb..0000000 --- a/2.5/Dockerfile +++ /dev/null @@ -1,98 +0,0 @@ -FROM php:8-alpine AS binary-with-runtime - -RUN set -eux ; \ - apk add --no-cache --virtual .composer-rundeps \ - bash \ - coreutils \ - git \ - make \ - openssh-client \ - patch \ - subversion \ - tini \ - unzip \ - zip \ - $([ "$(apk --print-arch)" != "x86" ] && echo mercurial) \ - $([ "$(apk --print-arch)" != "armhf" ] && echo p7zip) - -RUN printf "# composer php cli ini settings\n\ -date.timezone=UTC\n\ -memory_limit=-1\n\ -" > $PHP_INI_DIR/php-cli.ini - -ENV COMPOSER_ALLOW_SUPERUSER 1 -ENV COMPOSER_HOME /tmp -ENV COMPOSER_VERSION 2.5.8 - -RUN set -eux ; \ - # install https://github.com/mlocati/docker-php-extension-installer - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /usr/local/bin/install-php-extensions \ - --url https://github.com/mlocati/docker-php-extension-installer/releases/download/1.2.58/install-php-extensions \ - ; \ - echo 182011b3dca5544a70fdeb587af44ed1760aa9a2ed37d787d0f280a99f92b008e638c37762360cd85583830a097665547849cb2293c4a0ee32c2a36ef7a349e2 /usr/local/bin/install-php-extensions | sha512sum --strict --check ; \ - chmod +x /usr/local/bin/install-php-extensions ; \ - # install necessary/useful extensions not included in base image - install-php-extensions \ - bz2 \ - zip \ - ; \ - # install public keys for snapshot and tag validation, see https://composer.github.io/pubkeys.html - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/keys.dev.pub \ - --url https://github.com/raw/composer/composer.github.io/e7f28b7200249f8e5bc912b42837d4598c74153a/snapshots.pub \ - ; \ - echo 572b963c4b7512a7de3c71a788772440b1996d918b1d2b5354bf8ba2bb057fadec6f7ac4852f2f8a8c01ab94c18141ce0422aec3619354b057216e0597db5ac2 /tmp/keys.dev.pub | sha512sum --strict --check ; \ - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/keys.tags.pub \ - --url https://github.com/raw/composer/composer.github.io/e7f28b7200249f8e5bc912b42837d4598c74153a/releases.pub \ - ; \ - echo 47f374b8840dcb0aa7b2327f13d24ab5f6ae9e58aa630af0d62b3d0ea114f4a315c5d97b21dcad3c7ffe2f0a95db2edec267adaba3f4f5a262abebe39aed3a28 /tmp/keys.tags.pub | sha512sum --strict --check ; \ - # download installer.php, see https://getcomposer.org/download/ - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/installer.php \ - --url https://github.com/raw/composer/getcomposer.org/f24b8f860b95b52167f91bbd3e3a7bcafe043038/web/installer \ - ; \ - echo 3137ad86bd990524ba1dedc2038309dfa6b63790d3ca52c28afea65dcc2eaead16fb33e9a72fd2a7a8240afaf26e065939a2d472f3b0eeaa575d1e8648f9bf19 /tmp/installer.php | sha512sum --strict --check ; \ - # install composer phar binary - php /tmp/installer.php \ - --no-ansi \ - --install-dir=/usr/bin \ - --filename=composer \ - --version=${COMPOSER_VERSION} \ - ; \ - composer --ansi --version --no-interaction ; \ - composer diagnose ; \ - rm -f /tmp/installer.php ; \ - find /tmp -type d -exec chmod -v 1777 {} + - -COPY docker-entrypoint.sh /docker-entrypoint.sh - -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/2.5/docker-entrypoint.sh b/2.5/docker-entrypoint.sh deleted file mode 100755 index dfb5f49..0000000 --- a/2.5/docker-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -isCommand() { - # Retain backwards compatibility with common CI providers, - # see: https://github.com/composer/docker/issues/107 - if [ "$1" = "sh" ]; then - return 1 - fi - - composer help --no-interaction "$1" > /dev/null 2>&1 -} - -# check if the first argument passed in looks like a flag -if [ "${1#-}" != "$1" ]; then - set -- /sbin/tini -- composer "$@" -# check if the first argument passed in is composer -elif [ "$1" = 'composer' ]; then - set -- /sbin/tini -- "$@" -# check if the first argument passed in matches a known command -elif isCommand "$1"; then - set -- /sbin/tini -- composer "$@" -fi - -exec "$@" diff --git a/2.6/Dockerfile b/2.6/Dockerfile deleted file mode 100644 index 5750bca..0000000 --- a/2.6/Dockerfile +++ /dev/null @@ -1,98 +0,0 @@ -FROM php:8-alpine AS binary-with-runtime - -RUN set -eux ; \ - apk add --no-cache --virtual .composer-rundeps \ - bash \ - coreutils \ - git \ - make \ - openssh-client \ - patch \ - subversion \ - tini \ - unzip \ - zip \ - $([ "$(apk --print-arch)" != "x86" ] && echo mercurial) \ - $([ "$(apk --print-arch)" != "armhf" ] && echo p7zip) - -RUN printf "# composer php cli ini settings\n\ -date.timezone=UTC\n\ -memory_limit=-1\n\ -" > $PHP_INI_DIR/php-cli.ini - -ENV COMPOSER_ALLOW_SUPERUSER 1 -ENV COMPOSER_HOME /tmp -ENV COMPOSER_VERSION 2.6.6 - -RUN set -eux ; \ - # install https://github.com/mlocati/docker-php-extension-installer - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /usr/local/bin/install-php-extensions \ - --url https://github.com/mlocati/docker-php-extension-installer/releases/download/1.2.58/install-php-extensions \ - ; \ - echo 182011b3dca5544a70fdeb587af44ed1760aa9a2ed37d787d0f280a99f92b008e638c37762360cd85583830a097665547849cb2293c4a0ee32c2a36ef7a349e2 /usr/local/bin/install-php-extensions | sha512sum --strict --check ; \ - chmod +x /usr/local/bin/install-php-extensions ; \ - # install necessary/useful extensions not included in base image - install-php-extensions \ - bz2 \ - zip \ - ; \ - # install public keys for snapshot and tag validation, see https://composer.github.io/pubkeys.html - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/keys.dev.pub \ - --url https://github.com/raw/composer/composer.github.io/e7f28b7200249f8e5bc912b42837d4598c74153a/snapshots.pub \ - ; \ - echo 572b963c4b7512a7de3c71a788772440b1996d918b1d2b5354bf8ba2bb057fadec6f7ac4852f2f8a8c01ab94c18141ce0422aec3619354b057216e0597db5ac2 /tmp/keys.dev.pub | sha512sum --strict --check ; \ - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/keys.tags.pub \ - --url https://github.com/raw/composer/composer.github.io/e7f28b7200249f8e5bc912b42837d4598c74153a/releases.pub \ - ; \ - echo 47f374b8840dcb0aa7b2327f13d24ab5f6ae9e58aa630af0d62b3d0ea114f4a315c5d97b21dcad3c7ffe2f0a95db2edec267adaba3f4f5a262abebe39aed3a28 /tmp/keys.tags.pub | sha512sum --strict --check ; \ - # download installer.php, see https://getcomposer.org/download/ - curl \ - --silent \ - --fail \ - --location \ - --retry 3 \ - --output /tmp/installer.php \ - --url https://github.com/raw/composer/getcomposer.org/f24b8f860b95b52167f91bbd3e3a7bcafe043038/web/installer \ - ; \ - echo 3137ad86bd990524ba1dedc2038309dfa6b63790d3ca52c28afea65dcc2eaead16fb33e9a72fd2a7a8240afaf26e065939a2d472f3b0eeaa575d1e8648f9bf19 /tmp/installer.php | sha512sum --strict --check ; \ - # install composer phar binary - php /tmp/installer.php \ - --no-ansi \ - --install-dir=/usr/bin \ - --filename=composer \ - --version=${COMPOSER_VERSION} \ - ; \ - composer --ansi --version --no-interaction ; \ - composer diagnose ; \ - rm -f /tmp/installer.php ; \ - find /tmp -type d -exec chmod -v 1777 {} + - -COPY docker-entrypoint.sh /docker-entrypoint.sh - -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/2.6/docker-entrypoint.sh b/2.6/docker-entrypoint.sh deleted file mode 100755 index dfb5f49..0000000 --- a/2.6/docker-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -isCommand() { - # Retain backwards compatibility with common CI providers, - # see: https://github.com/composer/docker/issues/107 - if [ "$1" = "sh" ]; then - return 1 - fi - - composer help --no-interaction "$1" > /dev/null 2>&1 -} - -# check if the first argument passed in looks like a flag -if [ "${1#-}" != "$1" ]; then - set -- /sbin/tini -- composer "$@" -# check if the first argument passed in is composer -elif [ "$1" = 'composer' ]; then - set -- /sbin/tini -- "$@" -# check if the first argument passed in matches a known command -elif isCommand "$1"; then - set -- /sbin/tini -- composer "$@" -fi - -exec "$@" diff --git a/2.7/docker-entrypoint.sh b/2.7/docker-entrypoint.sh deleted file mode 100755 index dfb5f49..0000000 --- a/2.7/docker-entrypoint.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -isCommand() { - # Retain backwards compatibility with common CI providers, - # see: https://github.com/composer/docker/issues/107 - if [ "$1" = "sh" ]; then - return 1 - fi - - composer help --no-interaction "$1" > /dev/null 2>&1 -} - -# check if the first argument passed in looks like a flag -if [ "${1#-}" != "$1" ]; then - set -- /sbin/tini -- composer "$@" -# check if the first argument passed in is composer -elif [ "$1" = 'composer' ]; then - set -- /sbin/tini -- "$@" -# check if the first argument passed in matches a known command -elif isCommand "$1"; then - set -- /sbin/tini -- composer "$@" -fi - -exec "$@" diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index ee6226c..8ced4bd 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -2,9 +2,9 @@ set -Eeuo pipefail declare -A aliases=( - [1.10]='1' - [2.2]='lts' - [2.7]='2 latest' + [legacy]='1' + [lts]='lts' + [latest]='2 latest' ) self="$(basename "${BASH_SOURCE[0]}")" @@ -82,7 +82,7 @@ EOH for directory in "${directories[@]}"; do commit="$(dirCommit "$directory")" version="$(extractVersion "$commit" "$directory")" - tags=("$version" "$directory" "${aliases[$directory]:-}") + tags=("$version" "${version%.*}" "${aliases[$directory]:-}") parent="$(awk 'toupper($1) == "FROM" { print $2; exit }' "$directory/Dockerfile")" arches="${parentRepoToArches[$parent]}" diff --git a/2.7/Dockerfile b/latest/Dockerfile similarity index 100% rename from 2.7/Dockerfile rename to latest/Dockerfile diff --git a/2.2/docker-entrypoint.sh b/latest/docker-entrypoint.sh similarity index 100% rename from 2.2/docker-entrypoint.sh rename to latest/docker-entrypoint.sh diff --git a/1.10/Dockerfile b/legacy/Dockerfile similarity index 100% rename from 1.10/Dockerfile rename to legacy/Dockerfile diff --git a/1.10/docker-entrypoint.sh b/legacy/docker-entrypoint.sh similarity index 100% rename from 1.10/docker-entrypoint.sh rename to legacy/docker-entrypoint.sh diff --git a/2.2/Dockerfile b/lts/Dockerfile similarity index 100% rename from 2.2/Dockerfile rename to lts/Dockerfile diff --git a/2.3/docker-entrypoint.sh b/lts/docker-entrypoint.sh similarity index 100% rename from 2.3/docker-entrypoint.sh rename to lts/docker-entrypoint.sh