mirror of
https://github.com/docker/compose.git
synced 2026-11-13 05:46:19 +00:00
Some checks are pending
ci / validate (lint) (push) Waiting to run
ci / validate (relay-lint) (push) Waiting to run
ci / validate (relay-test) (push) Waiting to run
ci / validate (validate-docs) (push) Waiting to run
ci / validate (validate-go-mod) (push) Waiting to run
ci / validate (validate-headers) (push) Waiting to run
ci / validate (validate-mocks) (push) Waiting to run
ci / binary (push) Waiting to run
ci / binary-finalize (push) Blocked by required conditions
ci / bin-image-test (push) Waiting to run
ci / relay-image-test (push) Waiting to run
ci / test (push) Waiting to run
ci / e2e (plugin, oldstable, graphdriver) (push) Waiting to run
ci / e2e (standalone, oldstable, graphdriver) (push) Waiting to run
ci / e2e (plugin, stable, containerd) (push) Waiting to run
ci / e2e (plugin, stable, graphdriver) (push) Waiting to run
ci / e2e (standalone, stable, containerd) (push) Waiting to run
ci / e2e (standalone, stable, graphdriver) (push) Waiting to run
ci / coverage (push) Blocked by required conditions
ci / ci-ok (push) Blocked by required conditions
ci / release (push) Blocked by required conditions
merge / bin-image-prepare (push) Waiting to run
merge / bin-image (push) Blocked by required conditions
merge / relay-image (push) Waiting to run
merge / module-image (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
zizmor / zizmor (push) Waiting to run
This release includes 12 security fixes following the security policy: - net/http: HTTP/1 server crash due to MaxBytesReader header race For HTTP/1 servers, when MaxBytesReader's limit is exceeded, "Connection: close" header is automatically set without synchronization, which might race with another header being set explicitly in the server handler. As a result, an HTTP/1 server that utilizes MaxBytesReader or MaxBytesHandler can crash due to runtime panic if its handler reads the request body concurrently with writing the response header. Thanks to Jakub Ciolek (https://ciolek.dev) for reporting this issue. This is CVE-2026-97054 and Go issue https://go.dev/issue/82563. - cmd/go: unexpected code execution via --sysroot, -target, -isysroot, -Wl,-syslibroot, and -x cgo flags Building a malicious package that uses cgo could cause arbitrary code execution at build time through several compiler and linker flags permitted in "#cgo" directives. Specifically, "--sysroot" in GCC and Clang relocates compiler subprograms, spec files, and CRT startup objects to an attacker-controlled directory; "-target" in Clang falls back to executing target helper tools from the current working directory when not found in PATH; "-isysroot" and "-Wl,-syslibroot" can pass a regular file on disk to GNU ld.bfd, which interprets it as a positional linker script; and "-x" permitted specifying arbitrary compiler input languages beyond those supported by cgo. "--sysroot" and "-target" are now disallowed in "#cgo" flags, "-isysroot" and "-Wl,-syslibroot" are verified not to point to regular files, and "-x" is restricted to the C, C++, Objective-C, and assembler languages supported by cgo. This issue was found by the Go Security Team during an internal audit. This is CVE-2026-97033 and Go issue https://go.dev/issue/82577. - cmd/go: arbitrary command execution via GCC spec files in cgo linker search directories When using GCC, building a malicious package that uses cgo could cause arbitrary command execution at link time via untrusted GCC spec files ("specs" or "*.spec"). When linking with "-fopenmp", "-fopenacc", or "-fsanitize=" in "#cgo LDFLAGS", GCC's built-in link spec evaluates "%:include(libgomp.spec)" or "%:include(libsanitizer.spec)" and searches for spec files in "-L" and sysroot directories (including subdirectories and multilib sibling directories such as "../lib64"), as well as the working directory when "-fopenmp" or "-fopenacc" is used or when "-fsanitize=" is combined with "-static" or "-static-lib*". The go command now rejects "-L", "-isysroot", and "-Wl,-syslibroot" directories (and the working and package directories when applicable) that contain GCC spec files, and disallows "@" and "-" prefixes in "-fsanitize=" compiler flag values. This issue was found by the Go Security Team during an internal audit. This is CVE-2026-97034 and Go issue https://go.dev/issue/82576. - cmd/go: unexpected code execution and arbitrary file write via Clang -gen-* and GCC -gnat* flags in cgo When using Clang or GCC, building a malicious package that uses cgo could cause unexpected code execution at build time or write files to arbitrary directories via "-gen-" or "-gnat" flags in "#cgo" directives. The "-g*" wildcard in the compiler and linker flag allowlists previously matched Clang's two-argument "-gen-cdb-fragment-path " flag and GCC's two-argument "-gnatO " flag, permitting compilation database fragments and sidecar output files to be written to arbitrary directories and desynchronizing flag argument parsing between the go command and the compiler driver so that subsequent arguments could be passed as unvalidated positional inputs to the linker. "-gen-" and "-gnat" flags are now disallowed in "#cgo" compiler and linker flags. This issue was found by the Go Security Team during an internal audit. This is CVE-2026-97035 and Go issue https://go.dev/issue/82575. - cmd/go: arbitrary code execution during build on darwin via "-l to_library" in cgo On Darwin, building a malicious package that uses cgo could cause arbitrary code execution when using the Apple linker due to passing "-l to_library " in a "#cgo LDFLAGS" directive. The Apple linker recombines the separated arguments "-l" and "to_library" into "-lto_library", which loads an arbitrary LTO plugin dynamic library at link time. The go command now disallows "-l" followed by "to_library" in "#cgo LDFLAGS", rejects "-lazy_library", "-lazy_framework", "-load_hidden", "-library", and "-library-path", and checks recombined "-l" arguments against disallowed linker flags and patterns. Thanks to Ali Sherif (https://www.linkedin.com/in/ali-sherif-13812b276/) for reporting this issue. This is CVE-2026-97036 and Go issue https://go.dev/issue/82574. - cmd/go: linker script injection via split -Wl, flags and Darwin or symbol linker flags in cgo Building a malicious package that uses cgo could cause arbitrary code execution at link time by passing linker script files to the host linker via "#cgo LDFLAGS". Split "-Wl," flags that consume a following argument (such as "-Wl,-rpath", "-Wl,--just-symbols", and "-Wl,-undefined") previously accepted a bare second argument without a "-Wl," prefix, which the compiler driver passes directly to the linker as a positional input file. Additionally, when using GNU ld.bfd, flags such as "-framework", "-Wl,-framework", "-Wl,-undefined", "-Wl,--just-symbols", "-Wl,-R", "-Wl,-subsystem", and (on non-Darwin platforms) "-Wl,-sectcreate" could cause ld.bfd to interpret their arguments as linker scripts if they named a regular file on disk. The go command now requires a "-Wl," prefix on the second token of split "-Wl," flags (except "-Wl,-R"), verifies that these flags do not reference linker script files, and disallows bare "-Wl,--warn-backrefs-exclude". This issue was found by the Go Security Team during an internal audit. This is CVE-2026-97037 and Go issue https://go.dev/issue/82573. - cmd/go: arbitrary code execution via crafted .syso files and cgo linker input files Building a malicious package containing ".syso" files or cgo linker inputs could inject arbitrary linker flags or execute arbitrary code at link time. Linker input files—including ".syso" files, direct object or library inputs in "#cgo LDFLAGS", and libraries in "-L" directories—were passed to the external linker without validating their format or checking for embedded linker options. Across platforms, this allowed executing GNU ld implicit linker scripts disguised as libraries or ".syso" files (or loaded via "-l:" or "-l" containing path separators), injecting unallowlisted linker flags via PE/COFF ".drectve" sections on Windows or Mach-O "LC_LINKER_OPTION" load commands on Darwin, or invoking LTO plugins via GCC or LLVM LTO intermediate representation sections in ELF, PE/COFF, or Mach-O objects. The go command now verifies that ".syso" files, direct linker inputs, and libraries in "-L" directories are valid binary objects or archives that do not contain unallowlisted ".drectve" directives, "LC_LINKER_OPTION" load commands, or LTO IR sections, and disallows "-l:" and ":", "=", or path separators in "-l" flags. This issue was found by the Go Security Team during an internal audit. This is CVE-2026-97038 and Go issue https://go.dev/issue/82572. - cmd/go: flag sanitization bypass via "#cgo pkg-config:" directives Building a malicious package that uses "#cgo pkg-config:" directives could load untrusted pkg-config ".pc" files or inject unvalidated compiler and linker flags. The pkg-config flag allowlist previously permitted "--with-path=" and "--personality=", allowed "--define-variable=" values beginning with "=" or "$" (which can rewrite paths in system ".pc" files into sysroot-prefixed "-L=" or "-L$SYSROOT" linker search paths), and allowed package arguments ending in ".pc" or containing path separators or "..", which caused pkg-config to load local ".pc" files directly from the package directory. In addition, flags returned by "pkg-config --cflags" in cgoCPPFLAGS were not checked when determining whether internal linking is safe. The go command now disallows "--with-path=", "--personality=", leading "=" or "$" characters in "--define-variable=" values, and local ".pc" paths in "#cgo pkg-config:" directives, and inspects cgoCPPFLAGS when checking internal linking compatibility. This issue was found by the Go Security Team during an internal audit. This is CVE-2026-97039 and Go issue https://go.dev/issue/82571. - cmd/go, cmd/link: cgo directive injection via .syso files disguised as Go object files Building a package containing a crafted ".syso" file could bypass cgo flag validation and inject arbitrary linker flags when linking. When loading ".syso" entries from a package archive, the linker only checked for recognized host object headers (ELF, Mach-O, PE, and XCOFF) before falling through to Go object parsing. A ".syso" file beginning with a "go object" header was parsed as a Go compiler object, allowing untrusted cgo metadata directives (such as "cgo_ldflag" or "cgo_dynamic_linker") embedded in the ".syso" file to be passed to the external linker without validation. Additionally, ".syso" filenames longer than 16 bytes lost their ".syso" extension when truncated in archive headers, and unrecognized ".syso" formats forced external linking in pure-Go builds. The linker now rejects ".syso" files that are not recognized host object formats, and "cmd/go" and "cmd/pack" preserve the ".syso" suffix when truncating long archive member names. Thanks to RyotaK (https://ryotak.net) of GMO Flatt Security Inc. for reporting this issue. This is CVE-2026-97040 and Go issue https://go.dev/issue/82570. - cmd/compile, cmd/link: host linker flag injection via //go:cgo_* directives Building a malicious package containing "//go:cgo_*" compiler directives could inject arbitrary flags into the external linker invocation on ELF platforms. The compiler and linker did not reject commas in "//go:cgo_import_dynamic", "//go:cgo_export_dynamic", "//go:cgo_export_static", "//go:cgo_import_static", and "//go:cgo_dynamic_linker" directives, and the linker passed the dynamic linker path using "-Wl,--dynamic-linker,". Furthermore, the two-argument form of "//go:cgo_import_dynamic" (which is permitted in non-cgo Go source files) could overwrite the external symbol name of a symbol already marked for cgo export. A symbol name or dynamic linker path containing a comma or leading "@" could split "-Wl,--export-dynamic-symbol=" or "-Wl,--dynamic-linker," into arbitrary host linker flags or response file arguments. The compiler and linker now reject commas in "//go:cgo_*" symbol and dynamic linker directives, the linker passes "-Wl,--dynamic-linker=", and "cgo_import_dynamic" no longer overwrites symbols exported via "cgo_export_dynamic" or "cgo_export_static". Thanks to RyotaK (https://ryotak.net) of GMO Flatt Security Inc. for reporting this issue. This is CVE-2026-97041 and Go issue https://go.dev/issue/82569. - cmd/cgo, cmd/compile, cmd/link: linker flag injection via cgo_import_dynamic and PE DLL names Building a malicious package that uses "//go:cgo_import_dynamic" or links against a crafted PE object on Windows could pass unsafe library arguments to the external linker. The compiler only checked the first character of the library name in "//go:cgo_import_dynamic" directives and skipped validation in cgo-generated files. In addition, on Windows, "cmd/cgo" and "cmd/link" did not validate imported DLL names extracted from PE object files before emitting "-l" flags for the external linker, allowing a crafted DLL name containing ".." path traversal or special characters to reference arbitrary files on disk. The compiler now validates every character of the library name in "//go:cgo_import_dynamic" directives (including in cgo-generated files on Windows) and rejects ".." path traversal, and "cmd/cgo" and "cmd/link" reject PE imported DLL names containing path separators, "..", ":", or leading "-" or "@". This issue was found by the Go Security Team during an internal audit. This is CVE-2026-97042 and Go issue https://go.dev/issue/82568. - cmd/go, cmd/compile: unexpected code execution via escaped quotes in //go:cgo_ldflag Building a malicious package that uses cgo could bypass "#cgo LDFLAGS" validation and cause unexpected code execution at build time, or cause the go command to panic, via crafted quoting in "//go:cgo_ldflag" directives. When "cmd/cgo" generates "_cgo_gotypes.go", it quotes each "#cgo LDFLAGS" argument with strconv.Quote in a "//go:cgo_ldflag" directive, but "cmd/compile" and "cmd/go" parsed those directives by splitting on raw quote characters without handling backslash escapes or unquoting the string. This mismatch allowed disallowed linker flags or unvalidated linker search paths to be smuggled past the go command's flag checks and passed to the external linker. In addition, deduplicating LDFLAGS in the go command could panic with an out-of-bounds slice index when a prefix of the flag list matched near the end of the slice. "cmd/compile" and "cmd/go" now properly handle backslash-escaped quotes and unquote "//go:cgo_*" pragma strings with strconv.Unquote, and the slice bounds check in processCgoOutputs has been fixed. This issue was found by the Go Security Team during an internal audit. This is CVE-2026-97043 and Go issue https://go.dev/issue/82567. release notes: https://go.dev/doc/devel/release#go1.27.4 Signed-off-by: Paweł Gronowski <git@grono.dev>
235 lines
7.7 KiB
Docker
235 lines
7.7 KiB
Docker
# 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.27.4
|
|
ARG XX_VERSION=1.9.0
|
|
ARG GOLANGCI_LINT_VERSION=v2.15.0
|
|
ARG ADDLICENSE_VERSION=v1.0.0
|
|
# Keep in sync with GOTESTSUM_VERSION in the Makefile
|
|
ARG GOTESTSUM_VERSION=v1.13.0
|
|
|
|
ARG BUILD_TAGS="e2e"
|
|
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
|
|
|
|
# osxcross contains the MacOSX cross toolchain for xx
|
|
FROM crazymax/osxcross:15.5-alpine AS osxcross
|
|
|
|
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}-alpine3.23 AS base
|
|
COPY --from=xx / /
|
|
RUN apk add --no-cache \
|
|
clang \
|
|
docker \
|
|
file \
|
|
findutils \
|
|
git \
|
|
make \
|
|
protoc \
|
|
protobuf-dev
|
|
WORKDIR /src
|
|
ENV CGO_ENABLED=0
|
|
|
|
FROM base AS build-base
|
|
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 mocks-generate
|
|
RUN --mount=type=bind,target=.,rw \
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
--mount=type=cache,target=/root/.cache/go-build \
|
|
make mocks && mkdir /out && cp pkg/mocks/*.go /out
|
|
|
|
FROM mocks-generate AS mocks-validate
|
|
RUN --mount=type=bind,target=.,rw <<EOT
|
|
set -e
|
|
git add -A
|
|
cp -f /out/* pkg/mocks/
|
|
diff=$(git status --porcelain -- pkg/mocks)
|
|
if [ -n "$diff" ]; then
|
|
echo >&2 'ERROR: Generated mocks differ. Please regenerate them with "make mocks"'
|
|
echo "$diff"
|
|
exit 1
|
|
fi
|
|
EOT
|
|
|
|
FROM build-base AS build
|
|
ARG BUILD_TAGS
|
|
ARG BUILD_FLAGS
|
|
ARG TARGETPLATFORM
|
|
ARG MACOSX_VERSION_MIN=11.0
|
|
RUN --mount=type=bind,target=. \
|
|
--mount=type=cache,target=/root/.cache \
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
--mount=type=bind,from=osxcross,src=/osxsdk,target=/xx-sdk \
|
|
xx-go --wrap && \
|
|
if [ "$(xx-info os)" == "darwin" ]; then export CGO_ENABLED=1; export BUILD_TAGS=fsnotify,$BUILD_TAGS; fi && \
|
|
make build GO_BUILDTAGS="$BUILD_TAGS" DESTDIR=/out && \
|
|
xx-verify --static /out/docker-compose
|
|
|
|
FROM build-base AS lint
|
|
ARG BUILD_TAGS
|
|
ENV GOLANGCI_LINT_CACHE=/cache/golangci-lint
|
|
RUN --mount=type=bind,target=. \
|
|
--mount=type=cache,target=/root/.cache \
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
--mount=type=cache,target=/cache/golangci-lint \
|
|
--mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \
|
|
golangci-lint cache status && \
|
|
golangci-lint run --build-tags "$BUILD_TAGS" ./...
|
|
|
|
FROM build-base AS test
|
|
# the race detector requires cgo (ENV: base sets CGO_ENABLED=0, which an ARG can't override)
|
|
ENV CGO_ENABLED=1
|
|
ARG BUILD_TAGS
|
|
ARG GOTESTSUM_VERSION
|
|
RUN apk add --no-cache gcc musl-dev
|
|
RUN --mount=type=bind,target=. \
|
|
--mount=type=cache,target=/root/.cache \
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
rm -rf /tmp/coverage && \
|
|
mkdir -p /tmp/coverage && \
|
|
rm -rf /tmp/report && \
|
|
mkdir -p /tmp/report && \
|
|
go run gotest.tools/gotestsum@${GOTESTSUM_VERSION} --format testname --junitfile "/tmp/report/report.xml" -- -tags "$BUILD_TAGS" -v -race -cover -covermode=atomic $(go list $(TAGS) ./... | grep -vE 'e2e') -args -test.gocoverdir="/tmp/coverage" && \
|
|
go tool covdata percent -i=/tmp/coverage
|
|
|
|
FROM scratch AS test-coverage
|
|
COPY --from=test --link /tmp/coverage /
|
|
COPY --from=test --link /tmp/report /
|
|
|
|
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 -ignore validate -ignore testdata -ignore '**/testdata/**' -ignore resolvepath && \
|
|
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 '**/testdata/**' -ignore resolvepath -v
|
|
|
|
FROM base AS docsgen
|
|
WORKDIR /src
|
|
RUN --mount=target=. \
|
|
--mount=target=/root/.cache,type=cache \
|
|
--mount=type=cache,target=/go/pkg/mod \
|
|
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 /out/docker-compose /
|
|
FROM binary-unix AS binary-darwin
|
|
FROM binary-unix AS binary-linux
|
|
FROM scratch AS binary-windows
|
|
COPY --link --from=build /out/docker-compose /docker-compose.exe
|
|
FROM binary-$TARGETOS AS binary
|
|
# enable scanning for this stage
|
|
ARG BUILDKIT_SBOM_SCAN_STAGE=true
|
|
|
|
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 scratch AS release
|
|
COPY --from=releaser /out/ /
|
|
|
|
FROM --platform=$BUILDPLATFORM alpine AS module-releaser
|
|
WORKDIR /work
|
|
ARG TARGETOS
|
|
RUN --mount=from=binary \
|
|
mkdir -p /cli-plugins/compose/$TARGETOS && \
|
|
cp docker-compose* "/cli-plugins/compose/$TARGETOS/docker-compose$(ls docker-compose* | sed -e 's/^docker-compose//')"
|
|
|
|
FROM scratch AS module
|
|
ARG TARGETOS
|
|
COPY --from=module-releaser /cli-plugins/compose/$TARGETOS /cli-plugins/compose/$TARGETOS
|
|
COPY ./desktop-module/module-metadata.json /
|
|
COPY LICENSE /
|