diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index 8290879820f..00000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: 🐞 Bug -description: File a bug/issue -title: "[BUG] " -labels: ['status/0-triage', 'kind/bug'] -body: - - type: textarea - attributes: - label: Description - description: | - Briefly describe the problem you are having. - - Include both the current behavior (what you are seeing) as well as what you expected to happen. - validations: - required: true - - type: textarea - attributes: - label: Steps To Reproduce - description: Steps to reproduce the behavior. - placeholder: | - 1. In this environment... - 2. With this config... - 3. Run '...' - 4. See error... - validations: - required: false - - type: textarea - attributes: - label: Compose Version - description: | - Paste output of `docker compose version` and `docker-compose version`. - render: Text - validations: - required: false - - type: textarea - attributes: - label: Docker Environment - description: Paste output of `docker info`. - render: Text - validations: - required: false - - type: textarea - attributes: - label: Anything else? - description: | - Links? References? Anything that will give us more context about the issue you are encountering! - - Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index cc4b65bf24d..00000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,11 +0,0 @@ -blank_issues_enabled: true -contact_links: - - name: Docker Community Slack - url: https://dockr.ly/slack - about: 'Use the #docker-compose channel' - - name: Docker Support Forums - url: https://forums.docker.com/c/open-source-projects/compose/15 - about: 'Use the "Open Source Projects > Compose" category' - - name: 'Ask on Stack Overflow' - url: https://stackoverflow.com/questions/tagged/docker-compose - about: 'Use the [docker-compose] tag when creating new questions' diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml deleted file mode 100644 index 677a1684fc0..00000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ /dev/null @@ -1,13 +0,0 @@ -name: Feature request -description: Missing functionality? Come tell us about it! -labels: - - kind/feature - - status/0-triage -body: - - type: textarea - id: description - attributes: - label: Description - description: What is the feature you want to see? - validations: - required: true diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 00e87ff8eaa..00000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,6 +0,0 @@ -**What I did** - -**Related issue** -<!-- If this is a bug fix, make sure your description includes "fixes #xxxx", or "closes #xxxx" --> - -**(not mandatory) A picture of a cute animal, if possible in relation to what you did** diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 0662f7c9d81..00000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 2 -updates: - - package-ecosystem: gomod - directory: / - schedule: - interval: daily - ignore: - # docker/buildx + docker/cli + docker/docker require coordination to - # ensure compatibility between them - - dependency-name: "github.com/docker/buildx" - # buildx is still 0.x - update-types: ["version-update:semver-minor"] - - dependency-name: "github.com/docker/cli" - # docker/cli uses CalVer rather than SemVer - update-types: ["version-update:semver-major", "version-update:semver-minor"] - - dependency-name: "github.com/docker/docker" - # docker/docker uses CalVer rather than SemVer - update-types: ["version-update:semver-major", "version-update:semver-minor"] diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index a461723c34b..00000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,59 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 180 - -# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 7 - -# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) -onlyLabels: [] - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - "kind/feature" - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: false - -# Set to true to ignore issues with an assignee (defaults to false) -exemptAssignees: true - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. - -# Comment to post when removing the stale label. -unmarkComment: > - This issue has been automatically marked as not stale anymore due to the recent activity. - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - This issue has been automatically closed because it had not recent activity during the stale period. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 - -# Limit to only `issues` or `pulls` -only: issues - -# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': -# pulls: -# daysUntilStale: 30 -# markComment: > -# This pull request has been automatically marked as stale because it has not had -# recent activity. It will be closed if no further activity occurs. Thank you -# for your contributions. - -# issues: -# exemptLabels: -# - confirmed \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 566ccbe9555..00000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,234 +0,0 @@ -name: ci - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: - - 'v2' - tags: - - 'v*' - pull_request: - workflow_dispatch: - inputs: - debug_enabled: - description: 'To run with tmate enter "debug_enabled"' - required: false - default: "false" - -env: - DESTDIR: "./bin" - DOCKER_CLI_VERSION: "20.10.17" - -permissions: - contents: read # to fetch code (actions/checkout) - -jobs: - prepare: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.platforms.outputs.matrix }} - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Create matrix - id: platforms - run: | - echo ::set-output name=matrix::$(docker buildx bake binary-cross --print | jq -cr '.target."binary-cross".platforms') - - - name: Show matrix - run: | - echo ${{ steps.platforms.outputs.matrix }} - - validate: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - target: - - lint - - validate-go-mod - - validate-headers - - validate-docs - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Run - run: | - make ${{ matrix.target }} - - binary: - runs-on: ubuntu-latest - needs: - - prepare - strategy: - fail-fast: false - matrix: - platform: ${{ fromJson(needs.prepare.outputs.matrix) }} - steps: - - - name: Prepare - run: | - platform=${{ matrix.platform }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Build - uses: docker/bake-action@v2 - with: - targets: release - set: | - *.platform=${{ matrix.platform }} - *.cache-from=type=gha,scope=binary-${{ env.PLATFORM_PAIR }} - *.cache-to=type=gha,scope=binary-${{ env.PLATFORM_PAIR }},mode=max - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: compose - path: ${{ env.DESTDIR }}/* - if-no-files-found: error - - test: - runs-on: ubuntu-latest - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Test - uses: docker/bake-action@v2 - with: - targets: test - set: | - *.cache-from=type=gha,scope=test - *.cache-to=type=gha,scope=test - - e2e: - runs-on: ubuntu-latest - env: - DESTDIR: "./bin/build" - strategy: - fail-fast: false - matrix: - mode: - - plugin - - standalone - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version-file: 'go.mod' - check-latest: true - cache: true - - - name: Setup docker CLI - run: | - curl https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_CLI_VERSION}.tgz | tar xz - sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version - - - name: Build - uses: docker/bake-action@v2 - with: - targets: binary - set: | - *.cache-from=type=gha,scope=binary-linux-amd64 - *.cache-from=type=gha,scope=binary-e2e-${{ matrix.mode }} - *.cache-to=type=gha,scope=binary-e2e-${{ matrix.mode }},mode=max - env: - BUILD_TAGS: e2e - - - name: Setup tmate session - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} - uses: mxschmitt/action-tmate@8b4e4ac71822ed7e0ad5fb3d1c33483e9e8fb270 # v3.11 - with: - limit-access-to-actor: true - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Test plugin mode - if: ${{ matrix.mode == 'plugin' }} - run: | - make e2e-compose - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - - - name: Test standalone mode - if: ${{ matrix.mode == 'standalone' }} - run: | - rm -f /usr/local/bin/docker-compose - cp bin/build/docker-compose /usr/local/bin - make e2e-compose-standalone - - release: - permissions: - contents: write # to create a release (ncipollo/release-action) - - runs-on: ubuntu-latest - needs: - - binary - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - name: compose - path: ${{ env.DESTDIR }} - - - name: Create checksums - working-directory: ${{ env.DESTDIR }} - run: | - find . -type f -print0 | sort -z | xargs -r0 shasum -a 256 -b | sed 's# \*\./# *#' > $RUNNER_TEMP/checksums.txt - shasum -a 256 -U -c $RUNNER_TEMP/checksums.txt - mv $RUNNER_TEMP/checksums.txt . - cat checksums.txt | while read sum file; do echo "$sum $file" > ${file#\*}.sha256; done - - - name: License - run: cp packaging/* ${{ env.DESTDIR }}/ - - - name: List artifacts - run: | - tree -nh ${{ env.DESTDIR }} - - - name: Check artifacts - run: | - find ${{ env.DESTDIR }} -type f -exec file -e ascii -- {} + - - - name: GitHub Release - if: startsWith(github.ref, 'refs/tags/v') - uses: ncipollo/release-action@58ae73b360456532aafd58ee170c045abbeaee37 # v1.10.0 - with: - artifacts: ${{ env.DESTDIR }}/* - generateReleaseNotes: true - draft: true - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index f14b76319d5..00000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Docs - -on: - release: - types: [published] - -permissions: {} -jobs: - open-pr: - permissions: - contents: write # to create branch (peter-evans/create-pull-request) - pull-requests: write # to create a PR (peter-evans/create-pull-request) - - runs-on: ubuntu-latest - steps: - - - name: Checkout docs repo - uses: actions/checkout@v3 - with: - token: ${{ secrets.GHPAT_DOCS_DISPATCH }} - repository: docker/docs - ref: main - - - name: Prepare - run: | - rm -rf ./_data/compose-cli/* - - - name: Build - uses: docker/build-push-action@v3 - with: - context: ${{ github.server_url }}/${{ github.repository }}.git#${{ github.event.release.name }} - target: docs-reference - outputs: ./_data/compose-cli - - - name: Update compose_version in _config.yml - run: | - sed -i "s|^compose_version\:.*|compose_version\: \"${{ github.event.release.name }}\"|g" _config.yml - cat _config.yml | yq .compose_version - - - name: Commit changes - run: | - git add -A . - - - name: Create PR on docs repo - uses: peter-evans/create-pull-request@923ad837f191474af6b1721408744feb989a4c27 # v4.0.4 - with: - token: ${{ secrets.GHPAT_DOCS_DISPATCH }} - push-to-fork: docker-tools-robot/docker.github.io - commit-message: Update Compose reference API to ${{ github.event.release.name }} - signoff: true - branch: dispatch/compose-api-reference-${{ github.event.release.name }} - delete-branch: true - title: Update Compose reference API to ${{ github.event.release.name }} - body: | - Update the Compose reference API documentation to keep in sync with the latest release `${{ github.event.release.name }}` - draft: false diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml deleted file mode 100644 index 690cda7a820..00000000000 --- a/.github/workflows/merge.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: merge - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -on: - push: - branches: - - 'v2' - tags: - - 'v*' - workflow_dispatch: - -permissions: - contents: read # to fetch code (actions/checkout) - -jobs: - e2e: - name: Build and test - runs-on: ${{ matrix.os }} - timeout-minutes: 15 - strategy: - fail-fast: false - matrix: - os: [desktop-windows, desktop-macos, desktop-m1] - # mode: [plugin, standalone] - mode: [plugin] - env: - GO111MODULE: "on" - steps: - - uses: actions/checkout@v3 - - - uses: actions/setup-go@v3 - with: - go-version-file: go.mod - cache: true - check-latest: true - - - name: List Docker resources on machine - run: | - docker ps --all - docker volume ls - docker network ls - docker image ls - - name: Remove Docker resources on machine - continue-on-error: true - run: | - docker kill $(docker ps -q) - docker rm -f $(docker ps -aq) - docker volume rm -f $(docker volume ls -q) - docker ps --all - - - name: Unit tests - run: make test - - - name: Build binaries - run: | - make - - name: Check arch of go compose binary - run: | - file ./bin/build/docker-compose - if: ${{ !contains(matrix.os, 'desktop-windows') }} - - - name: Test plugin mode - if: ${{ matrix.mode == 'plugin' }} - run: | - make e2e-compose - - - name: Test standalone mode - if: ${{ matrix.mode == 'standalone' }} - run: | - make e2e-compose-standalone - diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml deleted file mode 100644 index d9e63e54d6b..00000000000 --- a/.github/workflows/scorecards.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Scorecards supply-chain security -on: - # Only the default branch is supported. - branch_protection_rule: - schedule: - - cron: '44 9 * * 4' - push: - branches: [ "v2" ] - -# Declare default permissions as read only. -permissions: read-all - -jobs: - analysis: - name: Scorecards analysis - runs-on: ubuntu-latest - permissions: - # Needed to upload the results to code-scanning dashboard. - security-events: write - # Used to receive a badge. - id-token: write - - steps: - - name: "Checkout code" - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3.0.0 - with: - persist-credentials: false - - - name: "Run analysis" - uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # tag=v2.0.6 - with: - results_file: results.sarif - results_format: sarif - - # Publish the results for public repositories to enable scorecard badges. For more details, see - # https://github.com/ossf/scorecard-action#publishing-results. - # For private repositories, `publish_results` will automatically be set to `false`, regardless - # of the value entered here. - publish_results: true - - # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF - # format to the repository Actions tab. - - name: "Upload artifact" - uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # tag=v3.0.0 - with: - name: SARIF file - path: results.sarif - retention-days: 5 - - # Upload the results to GitHub's code scanning dashboard. - - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # tag=v1.0.26 - with: - sarif_file: results.sarif diff --git a/Dockerfile b/Dockerfile index 0dea9247d41..dd5b36725e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,183 +1,40 @@ -# syntax=docker/dockerfile:1 - - -# Copyright 2020 Docker Compose CLI authors - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -ARG GO_VERSION=1.19.4 -ARG XX_VERSION=1.1.2 -ARG GOLANGCI_LINT_VERSION=v1.49.0 -ARG ADDLICENSE_VERSION=v1.0.0 - -ARG BUILD_TAGS="e2e,kube" -ARG DOCS_FORMATS="md,yaml" -ARG LICENSE_FILES=".*\(Dockerfile\|Makefile\|\.go\|\.hcl\|\.sh\)" - -# xx is a helper for cross-compilation -FROM --platform=${BUILDPLATFORM} tonistiigi/xx:${XX_VERSION} AS xx - -FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint -FROM ghcr.io/google/addlicense:${ADDLICENSE_VERSION} AS addlicense - -FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION}-alpine AS base -COPY --from=xx / / -RUN apk add --no-cache \ - docker \ - file \ - git \ - make \ - protoc \ - protobuf-dev -WORKDIR /src -ENV CGO_ENABLED=0 - -FROM base AS build-base +ARG GO_VERSION=1.17-alpine +ARG GOLANGCI_LINT_VERSION=v1.40.1-alpine +ARG PROTOC_GEN_GO_VERSION=v1.4.3 + +FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS base +WORKDIR /compose-cli +RUN apk add --no-cache -vv \ + git \ + docker \ + make \ + protoc \ + protobuf-dev COPY go.* . RUN --mount=type=cache,target=/go/pkg/mod \ --mount=type=cache,target=/root/.cache/go-build \ go mod download -FROM build-base AS vendored -RUN --mount=type=bind,target=.,rw \ - --mount=type=cache,target=/go/pkg/mod \ - go mod tidy && mkdir /out && cp go.mod go.sum /out - -FROM scratch AS vendor-update -COPY --from=vendored /out / - -FROM vendored AS vendor-validate -RUN --mount=type=bind,target=.,rw <<EOT - set -e - git add -A - cp -rf /out/* . - diff=$(git status --porcelain -- go.mod go.sum) - if [ -n "$diff" ]; then - echo >&2 'ERROR: Vendor result differs. Please vendor your package with "make go-mod-tidy"' - echo "$diff" - exit 1 - fi -EOT - -FROM build-base AS build -ARG BUILD_TAGS -ARG TARGETPLATFORM -RUN xx-go --wrap -RUN --mount=type=bind,target=. \ - --mount=type=cache,target=/root/.cache \ - --mount=type=cache,target=/go/pkg/mod \ - make build GO_BUILDTAGS="$BUILD_TAGS" DESTDIR=/usr/bin && \ - xx-verify --static /usr/bin/docker-compose - -FROM build-base AS lint -ARG BUILD_TAGS -RUN --mount=type=bind,target=. \ - --mount=type=cache,target=/root/.cache \ - --mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \ - golangci-lint run --build-tags "$BUILD_TAGS" ./... - -FROM build-base AS test -ARG CGO_ENABLED=0 +FROM base AS make-compose-plugin +ENV CGO_ENABLED=0 +ARG TARGETOS +ARG TARGETARCH ARG BUILD_TAGS -RUN --mount=type=bind,target=. \ - --mount=type=cache,target=/root/.cache \ - --mount=type=cache,target=/go/pkg/mod \ - go test -tags "$BUILD_TAGS" -v -coverprofile=/tmp/coverage.txt -covermode=atomic $(go list $(TAGS) ./... | grep -vE 'e2e') && \ - go tool cover -func=/tmp/coverage.txt - -FROM scratch AS test-coverage -COPY --from=test /tmp/coverage.txt /coverage.txt - -FROM base AS license-set -ARG LICENSE_FILES -RUN --mount=type=bind,target=.,rw \ - --mount=from=addlicense,source=/app/addlicense,target=/usr/bin/addlicense \ - find . -regex "${LICENSE_FILES}" | xargs addlicense -c 'Docker Compose CLI' -l apache && \ - mkdir /out && \ - find . -regex "${LICENSE_FILES}" | cpio -pdm /out - -FROM scratch AS license-update -COPY --from=set /out / - -FROM base AS license-validate -ARG LICENSE_FILES -RUN --mount=type=bind,target=. \ - --mount=from=addlicense,source=/app/addlicense,target=/usr/bin/addlicense \ - find . -regex "${LICENSE_FILES}" | xargs addlicense -check -c 'Docker Compose CLI' -l apache -ignore validate -ignore testdata -ignore resolvepath -v - -FROM base AS docsgen -WORKDIR /src +ARG GIT_TAG RUN --mount=target=. \ - --mount=target=/root/.cache,type=cache \ - go build -o /out/docsgen ./docs/yaml/main/generate.go - -FROM --platform=${BUILDPLATFORM} alpine AS docs-build -RUN apk add --no-cache rsync git -WORKDIR /src -COPY --from=docsgen /out/docsgen /usr/bin -ARG DOCS_FORMATS -RUN --mount=target=/context \ - --mount=target=.,type=tmpfs <<EOT - set -e - rsync -a /context/. . - docsgen --formats "$DOCS_FORMATS" --source "docs/reference" - mkdir /out - cp -r docs/reference /out -EOT - -FROM scratch AS docs-update -COPY --from=docs-build /out /out - -FROM docs-build AS docs-validate -RUN --mount=target=/context \ - --mount=target=.,type=tmpfs <<EOT - set -e - rsync -a /context/. . - git add -A - rm -rf docs/reference/* - cp -rf /out/* ./docs/ - if [ -n "$(git status --porcelain -- docs/reference)" ]; then - echo >&2 'ERROR: Docs result differs. Please update with "make docs"' - git status --porcelain -- docs/reference - exit 1 - fi -EOT - -FROM scratch AS binary-unix -COPY --link --from=build /usr/bin/docker-compose / -FROM binary-unix AS binary-darwin -FROM binary-unix AS binary-linux -FROM scratch AS binary-windows -COPY --link --from=build /usr/bin/docker-compose /docker-compose.exe -FROM binary-$TARGETOS AS binary + --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/root/.cache/go-build \ + GOOS=${TARGETOS} \ + GOARCH=${TARGETARCH} \ + BUILD_TAGS=${BUILD_TAGS} \ + GIT_TAG=${GIT_TAG} \ + make COMPOSE_BINARY=/out/docker-compose -f builder.Makefile compose-plugin -FROM --platform=$BUILDPLATFORM alpine AS releaser -WORKDIR /work -ARG TARGETOS -ARG TARGETARCH -ARG TARGETVARIANT -RUN --mount=from=binary \ - mkdir -p /out && \ - # TODO: should just use standard arch - TARGETARCH=$([ "$TARGETARCH" = "amd64" ] && echo "x86_64" || echo "$TARGETARCH"); \ - TARGETARCH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH"); \ - cp docker-compose* "/out/docker-compose-${TARGETOS}-${TARGETARCH}${TARGETVARIANT}$(ls docker-compose* | sed -e 's/^docker-compose//')" +FROM debian:bullseye-slim AS compose-plugin +WORKDIR /root +COPY --from=make-compose-plugin /out/* /usr/local/bin/ -FROM scratch AS release -COPY --from=releaser /out/ / +RUN adduser --gecos "" --disabled-password --home /home/cfu --shell /bin/bash cfu +USER cfu -# docs-reference is a target used as remote context to update docs on release -# with latest changes on docs.docker.com. -# see open-pr job in .github/workflows/docs.yml for more details -FROM scratch AS docs-reference -COPY docs/reference/*.yaml . +ENTRYPOINT [ "docker-compose" ] diff --git a/README.md b/README.md index b6075af366e..54eca00a4e3 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,17 @@ - [Contributing](#contributing) # Docker Compose v2 -[![GitHub release](https://img.shields.io/github/release/docker/compose.svg?style=flat-square)](https://github.com/docker/compose/releases/latest) -[![PkgGoDev](https://img.shields.io/badge/go.dev-docs-007d9c?style=flat-square&logo=go&logoColor=white)](https://pkg.go.dev/github.com/docker/compose/v2) -[![Build Status](https://img.shields.io/github/workflow/status/docker/compose/ci?label=ci&logo=github&style=flat-square)](https://github.com/docker/compose/actions?query=workflow%3Aci) -[![Go Report Card](https://goreportcard.com/badge/github.com/docker/compose/v2?style=flat-square)](https://goreportcard.com/report/github.com/docker/compose/v2) -[![Codecov](https://codecov.io/gh/docker/compose/branch/master/graph/badge.svg?token=HP3K4Y4ctu)](https://codecov.io/gh/docker/compose) -[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/docker/compose/badge)](https://api.securityscorecards.dev/projects/github.com/docker/compose) +## ** Codefresh fork ** + +This repository fork is required because we need to build the docker image for the Codefresh managed docker-compose [image](https://hub.docker.com/repository/docker/codefresh/compose) + +The image is based on the official docker-compose github repo. The reason why it is not based on the official docker-compose image is because at the moment there is no ARM version of the docker-compose image and we need to keep codebase the same for AMD64 and ARM versions of the images. + +*Also This fork contains a minor change that is to run with the `--compatibility` flag turned on by default. This is to prevent any broken of the behavior of the v1 docker-compose tool. + + +[![Actions Status](https://github.com/docker/compose/workflows/Continuous%20integration/badge.svg)](https://github.com/docker/compose/actions) + ![Docker Compose](logo.png?raw=true "Docker Compose Logo") Docker Compose is a tool for running multi-container applications on Docker diff --git a/cmd/compose/compose.go b/cmd/compose/compose.go index ae0d13f1b0e..888779cd491 100644 --- a/cmd/compose/compose.go +++ b/cmd/compose/compose.go @@ -131,9 +131,9 @@ func (o *projectOptions) addProjectFlags(f *pflag.FlagSet) { f.StringVarP(&o.ProjectName, "project-name", "p", "", "Project name") f.StringArrayVarP(&o.ConfigPaths, "file", "f", []string{}, "Compose configuration files") f.StringVar(&o.EnvFile, "env-file", "", "Specify an alternate environment file.") - f.StringVar(&o.ProjectDir, "project-directory", "", "Specify an alternate working directory\n(default: the path of the, first specified, Compose file)") - f.StringVar(&o.WorkDir, "workdir", "", "DEPRECATED! USE --project-directory INSTEAD.\nSpecify an alternate working directory\n(default: the path of the, first specified, Compose file)") - f.BoolVar(&o.Compatibility, "compatibility", false, "Run compose in backward compatibility mode") + f.StringVar(&o.ProjectDir, "project-directory", "", "Specify an alternate working directory\n(default: the path of the Compose file)") + f.StringVar(&o.WorkDir, "workdir", "", "DEPRECATED! USE --project-directory INSTEAD.\nSpecify an alternate working directory\n(default: the path of the Compose file)") + f.BoolVar(&o.Compatibility, "compatibility", true, "Run compose in backward compatibility mode") _ = f.MarkHidden("workdir") } diff --git a/service.yaml b/service.yaml new file mode 100644 index 00000000000..e5119ff5e45 --- /dev/null +++ b/service.yaml @@ -0,0 +1 @@ +version: 1.3.0