mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-08-14 15:55:54 +08:00
Compare commits
135 Commits
v0.14.0-rc
...
v0.15
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1c1dbb2e4c | ||
![]() |
d677edae32 | ||
![]() |
0b0ed6ede9 | ||
![]() |
18fb636e2f | ||
![]() |
fe728e7780 | ||
![]() |
2375e88b06 | ||
![]() |
22d3d058f3 | ||
![]() |
03f3b35667 | ||
![]() |
49e562cf06 | ||
![]() |
d3a53189f7 | ||
![]() |
0496dae9d5 | ||
![]() |
40fcf992b1 | ||
![]() |
85c25f719c | ||
![]() |
875e4cd52e | ||
![]() |
24cedc6c0f | ||
![]() |
59f52c9505 | ||
![]() |
1e916ae6c6 | ||
![]() |
d342cb9d03 | ||
![]() |
9fdc99dc76 | ||
![]() |
ab835fd904 | ||
![]() |
87efbd43b5 | ||
![]() |
39db6159f9 | ||
![]() |
922328cbaf | ||
![]() |
aa0f90fdd6 | ||
![]() |
82b6826cd7 | ||
![]() |
1e3aec1ae2 | ||
![]() |
cfef22ddf0 | ||
![]() |
9e5ba66553 | ||
![]() |
747b75a217 | ||
![]() |
d8de5bb345 | ||
![]() |
eff1850d53 | ||
![]() |
a24043e9f1 | ||
![]() |
0902294e1a | ||
![]() |
ef4a165e48 | ||
![]() |
89810dc998 | ||
![]() |
250cd44d70 | ||
![]() |
5afb210d43 | ||
![]() |
03f84d2e83 | ||
![]() |
945e774a02 | ||
![]() |
947d6023e4 | ||
![]() |
c58599ca50 | ||
![]() |
f30e143428 | ||
![]() |
53b7cbc5cb | ||
![]() |
9a30215886 | ||
![]() |
b1cb658a31 | ||
![]() |
bc83ecb538 | ||
![]() |
ceaa4534f9 | ||
![]() |
9b6c4103af | ||
![]() |
4549283f44 | ||
![]() |
b2e907d5c2 | ||
![]() |
7427adb9b0 | ||
![]() |
1a93bbd3a5 | ||
![]() |
1f28985d20 | ||
![]() |
33a5528003 | ||
![]() |
7bfae2b809 | ||
![]() |
117c9016e1 | ||
![]() |
388af3576a | ||
![]() |
2061550bc1 | ||
![]() |
abf6c77d91 | ||
![]() |
9ad116aa8e | ||
![]() |
e3d5e64ec9 | ||
![]() |
0808747add | ||
![]() |
2e7da01560 | ||
![]() |
38d7d36f0a | ||
![]() |
55c86543ca | ||
![]() |
f98ef00ec7 | ||
![]() |
b948b07e2d | ||
![]() |
17c0a3794b | ||
![]() |
c0a986b43b | ||
![]() |
781dcbd196 | ||
![]() |
37c4ff0944 | ||
![]() |
6211f56b8d | ||
![]() |
cc9ea87142 | ||
![]() |
035236a5ed | ||
![]() |
99777eaf34 | ||
![]() |
cf68b5b878 | ||
![]() |
3f1aaa68d5 | ||
![]() |
f6830f3b86 | ||
![]() |
4fc4bc07ae | ||
![]() |
f6e57cf5b5 | ||
![]() |
b77648d5f8 | ||
![]() |
afcb609966 | ||
![]() |
946e0a5d74 | ||
![]() |
c4db5b252a | ||
![]() |
8afeb56a3b | ||
![]() |
fd801a12c1 | ||
![]() |
2f98e6f3ac | ||
![]() |
224c6a59bf | ||
![]() |
cbb75bbfd5 | ||
![]() |
72085dbdf0 | ||
![]() |
480b53f529 | ||
![]() |
f8c6a97edc | ||
![]() |
d4f088e689 | ||
![]() |
db3a8ad7ca | ||
![]() |
1d88c4b169 | ||
![]() |
6d95fb586e | ||
![]() |
1fb5d2a9ee | ||
![]() |
ba264138d6 | ||
![]() |
6375dc7230 | ||
![]() |
9cc6c7df70 | ||
![]() |
7ea5cffb98 | ||
![]() |
d2d21577fb | ||
![]() |
e344e2251b | ||
![]() |
833fe3b04f | ||
![]() |
d0cc9ed0cb | ||
![]() |
b30566438b | ||
![]() |
ec98985b4e | ||
![]() |
9428447cd2 | ||
![]() |
6112c41637 | ||
![]() |
a727de7d5f | ||
![]() |
4a8fcb7aa0 | ||
![]() |
771e66bf7a | ||
![]() |
7e0ab1a003 | ||
![]() |
e3e16ad088 | ||
![]() |
f2823515db | ||
![]() |
5ac9b78384 | ||
![]() |
fbb0f9b424 | ||
![]() |
699fa43f7f | ||
![]() |
bdf27ee797 | ||
![]() |
171fcbeb69 | ||
![]() |
370a5aa127 | ||
![]() |
13653fb84d | ||
![]() |
1b16594f4a | ||
![]() |
3905e8cf06 | ||
![]() |
177b95c972 | ||
![]() |
74fdbb5e7f | ||
![]() |
ac331d3569 | ||
![]() |
07c9b45bae | ||
![]() |
b91957444b | ||
![]() |
46c44c58ae | ||
![]() |
6aed54c35a | ||
![]() |
126fe653c7 | ||
![]() |
f0cbc95eaf | ||
![]() |
1a0f9fa96c | ||
![]() |
54a5c1ff93 |
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
@@ -31,7 +31,7 @@ env:
|
||||
|
||||
jobs:
|
||||
test-integration:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
env:
|
||||
TESTFLAGS_DOCKER: "-v --parallel=1 --timeout=30m"
|
||||
TEST_IMAGE_BUILD: "0"
|
||||
@@ -145,7 +145,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-22.04
|
||||
- ubuntu-24.04
|
||||
- macos-12
|
||||
- windows-2022
|
||||
env:
|
||||
@@ -212,7 +212,7 @@ jobs:
|
||||
path: ${{ env.TESTREPORTS_BASEDIR }}
|
||||
|
||||
prepare-binaries:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
matrix: ${{ steps.platforms.outputs.matrix }}
|
||||
steps:
|
||||
@@ -230,7 +230,7 @@ jobs:
|
||||
echo ${{ steps.platforms.outputs.matrix }}
|
||||
|
||||
binaries:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- prepare-binaries
|
||||
strategy:
|
||||
@@ -273,7 +273,7 @@ jobs:
|
||||
if-no-files-found: error
|
||||
|
||||
bin-image:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- test-integration
|
||||
- test-unit
|
||||
@@ -326,7 +326,7 @@ jobs:
|
||||
*.cache-to=type=gha,scope=bin-image,mode=max
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- test-integration
|
||||
- test-unit
|
||||
@@ -356,7 +356,7 @@ jobs:
|
||||
-
|
||||
name: GitHub Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
|
||||
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@@ -17,7 +17,7 @@ env:
|
||||
|
||||
jobs:
|
||||
codeql:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
|
4
.github/workflows/docs-release.yml
vendored
4
.github/workflows/docs-release.yml
vendored
@@ -12,7 +12,7 @@ on:
|
||||
|
||||
jobs:
|
||||
open-pr:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
if: ${{ (github.event.release.prerelease != true || github.event.inputs.tag != '') && github.repository == 'docker/buildx' }}
|
||||
steps:
|
||||
-
|
||||
@@ -57,7 +57,7 @@ jobs:
|
||||
VENDOR_MODULE: github.com/docker/buildx@${{ env.RELEASE_NAME }}
|
||||
-
|
||||
name: Create PR on docs repo
|
||||
uses: peter-evans/create-pull-request@70a41aba780001da0a30141984ae2a0c95d8704e # v6.0.2
|
||||
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
|
||||
with:
|
||||
token: ${{ secrets.GHPAT_DOCS_DISPATCH }}
|
||||
push-to-fork: docker-tools-robot/docker.github.io
|
||||
|
2
.github/workflows/docs-upstream.yml
vendored
2
.github/workflows/docs-upstream.yml
vendored
@@ -22,7 +22,7 @@ on:
|
||||
|
||||
jobs:
|
||||
docs-yaml:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
|
64
.github/workflows/e2e.yml
vendored
64
.github/workflows/e2e.yml
vendored
@@ -22,7 +22,7 @@ env:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -137,67 +137,9 @@ jobs:
|
||||
-
|
||||
name: Install k3s
|
||||
if: matrix.driver == 'kubernetes'
|
||||
uses: actions/github-script@v7
|
||||
uses: crazy-max/.github/.github/actions/install-k3s@fa6141aedf23596fb8bdcceab9cce8dadaa31bd9
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
|
||||
let wait = function(milliseconds) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (typeof(milliseconds) !== 'number') {
|
||||
throw new Error('milleseconds not a number');
|
||||
}
|
||||
setTimeout(() => resolve("done!"), milliseconds)
|
||||
});
|
||||
}
|
||||
|
||||
try {
|
||||
const kubeconfig="/tmp/buildkit-k3s/kubeconfig.yaml";
|
||||
core.info(`storing kubeconfig in ${kubeconfig}`);
|
||||
|
||||
await exec.exec('docker', ["run", "-d",
|
||||
"--privileged",
|
||||
"--name=buildkit-k3s",
|
||||
"-e", "K3S_KUBECONFIG_OUTPUT="+kubeconfig,
|
||||
"-e", "K3S_KUBECONFIG_MODE=666",
|
||||
"-v", "/tmp/buildkit-k3s:/tmp/buildkit-k3s",
|
||||
"-p", "6443:6443",
|
||||
"-p", "80:80",
|
||||
"-p", "443:443",
|
||||
"-p", "8080:8080",
|
||||
"rancher/k3s:${{ env.K3S_VERSION }}", "server"
|
||||
]);
|
||||
await wait(10000);
|
||||
|
||||
core.exportVariable('KUBECONFIG', kubeconfig);
|
||||
|
||||
let nodeName;
|
||||
for (let count = 1; count <= 5; count++) {
|
||||
try {
|
||||
const nodeNameOutput = await exec.getExecOutput("kubectl get nodes --no-headers -oname");
|
||||
nodeName = nodeNameOutput.stdout
|
||||
} catch (error) {
|
||||
core.info(`Unable to resolve node name (${error.message}). Attempt ${count} of 5.`)
|
||||
} finally {
|
||||
if (nodeName) {
|
||||
break;
|
||||
}
|
||||
await wait(5000);
|
||||
}
|
||||
}
|
||||
if (!nodeName) {
|
||||
throw new Error(`Unable to resolve node name after 5 attempts.`);
|
||||
}
|
||||
|
||||
await exec.exec(`kubectl wait --for=condition=Ready ${nodeName}`);
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
-
|
||||
name: Print KUBECONFIG
|
||||
if: matrix.driver == 'kubernetes'
|
||||
run: |
|
||||
yq ${{ env.KUBECONFIG }}
|
||||
version: ${{ env.K3S_VERSION }}
|
||||
-
|
||||
name: Launch remote buildkitd
|
||||
if: matrix.driver == 'remote'
|
||||
|
68
.github/workflows/validate.yml
vendored
68
.github/workflows/validate.yml
vendored
@@ -17,16 +17,63 @@ on:
|
||||
- '.github/releases.json'
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
includes: ${{ steps.matrix.outputs.includes }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Matrix
|
||||
id: matrix
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
let def = {};
|
||||
await core.group(`Parsing definition`, async () => {
|
||||
const printEnv = Object.assign({}, process.env, {
|
||||
GOLANGCI_LINT_MULTIPLATFORM: process.env.GITHUB_REPOSITORY === 'docker/buildx' ? '1' : ''
|
||||
});
|
||||
const resPrint = await exec.getExecOutput('docker', ['buildx', 'bake', 'validate', '--print'], {
|
||||
ignoreReturnCode: true,
|
||||
env: printEnv
|
||||
});
|
||||
if (resPrint.stderr.length > 0 && resPrint.exitCode != 0) {
|
||||
throw new Error(res.stderr);
|
||||
}
|
||||
def = JSON.parse(resPrint.stdout.trim());
|
||||
});
|
||||
await core.group(`Generating matrix`, async () => {
|
||||
const includes = [];
|
||||
for (const targetName of Object.keys(def.target)) {
|
||||
const target = def.target[targetName];
|
||||
if (target.platforms && target.platforms.length > 0) {
|
||||
target.platforms.forEach(platform => {
|
||||
includes.push({
|
||||
target: targetName,
|
||||
platform: platform
|
||||
});
|
||||
});
|
||||
} else {
|
||||
includes.push({
|
||||
target: targetName
|
||||
});
|
||||
}
|
||||
}
|
||||
core.info(JSON.stringify(includes, null, 2));
|
||||
core.setOutput('includes', JSON.stringify(includes));
|
||||
});
|
||||
|
||||
validate:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
needs:
|
||||
- prepare
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- lint
|
||||
- validate-vendor
|
||||
- validate-docs
|
||||
- validate-generated-files
|
||||
include: ${{ fromJson(needs.prepare.outputs.includes) }}
|
||||
steps:
|
||||
-
|
||||
name: Prepare
|
||||
@@ -43,6 +90,9 @@ jobs:
|
||||
with:
|
||||
version: latest
|
||||
-
|
||||
name: Run
|
||||
run: |
|
||||
make ${{ matrix.target }}
|
||||
name: Validate
|
||||
uses: docker/bake-action@v4
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
set: |
|
||||
*.platform=${{ matrix.platform }}
|
||||
|
@@ -25,12 +25,22 @@ linters:
|
||||
disable-all: true
|
||||
|
||||
linters-settings:
|
||||
govet:
|
||||
enable:
|
||||
- nilness
|
||||
- unusedwrite
|
||||
# enable-all: true
|
||||
# disable:
|
||||
# - fieldalignment
|
||||
# - shadow
|
||||
depguard:
|
||||
rules:
|
||||
main:
|
||||
deny:
|
||||
# The io/ioutil package has been deprecated.
|
||||
# https://go.dev/doc/go1.16#ioutil
|
||||
- pkg: "github.com/containerd/containerd/errdefs"
|
||||
desc: The containerd errdefs package was migrated to a separate module. Use github.com/containerd/errdefs instead.
|
||||
- pkg: "github.com/containerd/containerd/log"
|
||||
desc: The containerd log package was migrated to a separate module. Use github.com/containerd/log instead.
|
||||
- pkg: "io/ioutil"
|
||||
desc: The io/ioutil package has been deprecated.
|
||||
forbidigo:
|
||||
|
@@ -4,7 +4,7 @@ ARG GO_VERSION=1.21
|
||||
ARG XX_VERSION=1.4.0
|
||||
|
||||
# for testing
|
||||
ARG DOCKER_VERSION=26.0.0
|
||||
ARG DOCKER_VERSION=26.1.4
|
||||
ARG GOTESTSUM_VERSION=v1.9.0
|
||||
ARG REGISTRY_VERSION=2.8.0
|
||||
ARG BUILDKIT_VERSION=v0.13.1
|
||||
|
@@ -153,6 +153,7 @@ made through a pull request.
|
||||
"akihirosuda",
|
||||
"crazy-max",
|
||||
"jedevc",
|
||||
"jsternberg",
|
||||
"tiborvass",
|
||||
"tonistiigi",
|
||||
]
|
||||
@@ -194,6 +195,11 @@ made through a pull request.
|
||||
Email = "me@jedevc.com"
|
||||
GitHub = "jedevc"
|
||||
|
||||
[people.jsternberg]
|
||||
Name = "Jonathan Sternberg"
|
||||
Email = "jonathan.sternberg@docker.com"
|
||||
GitHub = "jsternberg"
|
||||
|
||||
[people.thajeztah]
|
||||
Name = "Sebastiaan van Stijn"
|
||||
Email = "github@gone.nl"
|
||||
|
32
Makefile
32
Makefile
@@ -8,6 +8,8 @@ endif
|
||||
|
||||
export BUILDX_CMD ?= docker buildx
|
||||
|
||||
BAKE_TARGETS := binaries binaries-cross lint lint-gopls validate-vendor validate-docs validate-authors validate-generated-files
|
||||
|
||||
.PHONY: all
|
||||
all: binaries
|
||||
|
||||
@@ -19,13 +21,9 @@ build:
|
||||
shell:
|
||||
./hack/shell
|
||||
|
||||
.PHONY: binaries
|
||||
binaries:
|
||||
$(BUILDX_CMD) bake binaries
|
||||
|
||||
.PHONY: binaries-cross
|
||||
binaries-cross:
|
||||
$(BUILDX_CMD) bake binaries-cross
|
||||
.PHONY: $(BAKE_TARGETS)
|
||||
$(BAKE_TARGETS):
|
||||
$(BUILDX_CMD) bake $@
|
||||
|
||||
.PHONY: install
|
||||
install: binaries
|
||||
@@ -39,10 +37,6 @@ release:
|
||||
.PHONY: validate-all
|
||||
validate-all: lint test validate-vendor validate-docs validate-generated-files
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
$(BUILDX_CMD) bake lint
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
./hack/test
|
||||
@@ -55,22 +49,6 @@ test-unit:
|
||||
test-integration:
|
||||
TESTPKGS=./tests ./hack/test
|
||||
|
||||
.PHONY: validate-vendor
|
||||
validate-vendor:
|
||||
$(BUILDX_CMD) bake validate-vendor
|
||||
|
||||
.PHONY: validate-docs
|
||||
validate-docs:
|
||||
$(BUILDX_CMD) bake validate-docs
|
||||
|
||||
.PHONY: validate-authors
|
||||
validate-authors:
|
||||
$(BUILDX_CMD) bake validate-authors
|
||||
|
||||
.PHONY: validate-generated-files
|
||||
validate-generated-files:
|
||||
$(BUILDX_CMD) bake validate-generated-files
|
||||
|
||||
.PHONY: test-driver
|
||||
test-driver:
|
||||
./hack/test-driver
|
||||
|
10
README.md
10
README.md
@@ -187,12 +187,12 @@ through various "drivers". Each driver defines how and where a build should
|
||||
run, and have different feature sets.
|
||||
|
||||
We currently support the following drivers:
|
||||
- The `docker` driver ([guide](docs/manuals/drivers/docker.md), [reference](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver))
|
||||
- The `docker-container` driver ([guide](docs/manuals/drivers/docker-container.md), [reference](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver))
|
||||
- The `kubernetes` driver ([guide](docs/manuals/drivers/kubernetes.md), [reference](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver))
|
||||
- The `remote` driver ([guide](docs/manuals/drivers/remote.md))
|
||||
- The `docker` driver ([guide](https://docs.docker.com/build/drivers/docker/), [reference](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver))
|
||||
- The `docker-container` driver ([guide](https://docs.docker.com/build/drivers/docker-container/), [reference](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver))
|
||||
- The `kubernetes` driver ([guide](https://docs.docker.com/build/drivers/kubernetes/), [reference](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver))
|
||||
- The `remote` driver ([guide](https://docs.docker.com/build/drivers/remote/))
|
||||
|
||||
For more information on drivers, see the [drivers guide](docs/manuals/drivers/index.md).
|
||||
For more information on drivers, see the [drivers guide](https://docs.docker.com/build/drivers/).
|
||||
|
||||
## Working with builder instances
|
||||
|
||||
|
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/compose-spec/compose-go/v2/dotenv"
|
||||
@@ -107,6 +108,13 @@ func ParseCompose(cfgs []composetypes.ConfigFile, envs map[string]string) (*Conf
|
||||
}
|
||||
}
|
||||
|
||||
var ssh []string
|
||||
for _, bkey := range s.Build.SSH {
|
||||
sshkey := composeToBuildkitSSH(bkey)
|
||||
ssh = append(ssh, sshkey)
|
||||
}
|
||||
sort.Strings(ssh)
|
||||
|
||||
var secrets []string
|
||||
for _, bs := range s.Build.Secrets {
|
||||
secret, err := composeToBuildkitSecret(bs, cfg.Secrets[bs.Source])
|
||||
@@ -142,6 +150,7 @@ func ParseCompose(cfgs []composetypes.ConfigFile, envs map[string]string) (*Conf
|
||||
CacheFrom: s.Build.CacheFrom,
|
||||
CacheTo: s.Build.CacheTo,
|
||||
NetworkMode: &s.Build.Network,
|
||||
SSH: ssh,
|
||||
Secrets: secrets,
|
||||
ShmSize: shmSize,
|
||||
Ulimits: ulimits,
|
||||
@@ -275,7 +284,7 @@ type xbake struct {
|
||||
NoCacheFilter stringArray `yaml:"no-cache-filter,omitempty"`
|
||||
Contexts stringMap `yaml:"contexts,omitempty"`
|
||||
// don't forget to update documentation if you add a new field:
|
||||
// docs/manuals/bake/compose-file.md#extension-field-with-x-bake
|
||||
// https://github.com/docker/docs/blob/main/content/build/bake/compose-file.md#extension-field-with-x-bake
|
||||
}
|
||||
|
||||
type stringMap map[string]string
|
||||
@@ -325,6 +334,7 @@ func (t *Target) composeExtTarget(exts map[string]interface{}) error {
|
||||
}
|
||||
if len(xb.SSH) > 0 {
|
||||
t.SSH = dedupSlice(append(t.SSH, xb.SSH...))
|
||||
sort.Strings(t.SSH)
|
||||
}
|
||||
if len(xb.Platforms) > 0 {
|
||||
t.Platforms = dedupSlice(append(t.Platforms, xb.Platforms...))
|
||||
@@ -368,3 +378,17 @@ func composeToBuildkitSecret(inp composetypes.ServiceSecretConfig, psecret compo
|
||||
|
||||
return strings.Join(bkattrs, ","), nil
|
||||
}
|
||||
|
||||
// composeToBuildkitSSH converts secret from compose format to buildkit's
|
||||
// csv format.
|
||||
func composeToBuildkitSSH(sshKey composetypes.SSHKey) string {
|
||||
var bkattrs []string
|
||||
|
||||
bkattrs = append(bkattrs, sshKey.ID)
|
||||
|
||||
if sshKey.Path != "" {
|
||||
bkattrs = append(bkattrs, sshKey.Path)
|
||||
}
|
||||
|
||||
return strings.Join(bkattrs, "=")
|
||||
}
|
||||
|
@@ -32,6 +32,9 @@ services:
|
||||
- type=local,src=path/to/cache
|
||||
cache_to:
|
||||
- type=local,dest=path/to/cache
|
||||
ssh:
|
||||
- key=path/to/key
|
||||
- default
|
||||
secrets:
|
||||
- token
|
||||
- aws
|
||||
@@ -74,6 +77,7 @@ secrets:
|
||||
require.Equal(t, []string{"type=local,src=path/to/cache"}, c.Targets[1].CacheFrom)
|
||||
require.Equal(t, []string{"type=local,dest=path/to/cache"}, c.Targets[1].CacheTo)
|
||||
require.Equal(t, "none", *c.Targets[1].NetworkMode)
|
||||
require.Equal(t, []string{"default", "key=path/to/key"}, c.Targets[1].SSH)
|
||||
require.Equal(t, []string{
|
||||
"id=token,env=ENV_TOKEN",
|
||||
"id=aws,src=/root/.aws/credentials",
|
||||
@@ -278,6 +282,8 @@ services:
|
||||
- user/app:cache
|
||||
tags:
|
||||
- ct-addon:baz
|
||||
ssh:
|
||||
key: path/to/key
|
||||
args:
|
||||
CT_ECR: foo
|
||||
CT_TAG: bar
|
||||
@@ -287,6 +293,9 @@ services:
|
||||
tags:
|
||||
- ct-addon:foo
|
||||
- ct-addon:alp
|
||||
ssh:
|
||||
- default
|
||||
- other=path/to/otherkey
|
||||
platforms:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
@@ -329,6 +338,7 @@ services:
|
||||
require.Equal(t, []string{"linux/amd64", "linux/arm64"}, c.Targets[0].Platforms)
|
||||
require.Equal(t, []string{"user/app:cache", "type=local,src=path/to/cache"}, c.Targets[0].CacheFrom)
|
||||
require.Equal(t, []string{"user/app:cache", "type=local,dest=path/to/cache"}, c.Targets[0].CacheTo)
|
||||
require.Equal(t, []string{"default", "key=path/to/key", "other=path/to/otherkey"}, c.Targets[0].SSH)
|
||||
require.Equal(t, newBool(true), c.Targets[0].Pull)
|
||||
require.Equal(t, map[string]string{"alpine": "docker-image://alpine:3.13"}, c.Targets[0].Contexts)
|
||||
require.Equal(t, []string{"ct-fake-aws:bar"}, c.Targets[1].Tags)
|
||||
@@ -353,6 +363,8 @@ services:
|
||||
- user/app:cache
|
||||
tags:
|
||||
- ct-addon:foo
|
||||
ssh:
|
||||
- default
|
||||
x-bake:
|
||||
tags:
|
||||
- ct-addon:foo
|
||||
@@ -362,6 +374,9 @@ services:
|
||||
- type=local,src=path/to/cache
|
||||
cache-to:
|
||||
- type=local,dest=path/to/cache
|
||||
ssh:
|
||||
- default
|
||||
- key=path/to/key
|
||||
`)
|
||||
|
||||
c, err := ParseCompose([]composetypes.ConfigFile{{Content: dt}}, nil)
|
||||
@@ -370,6 +385,7 @@ services:
|
||||
require.Equal(t, []string{"ct-addon:foo", "ct-addon:baz"}, c.Targets[0].Tags)
|
||||
require.Equal(t, []string{"user/app:cache", "type=local,src=path/to/cache"}, c.Targets[0].CacheFrom)
|
||||
require.Equal(t, []string{"user/app:cache", "type=local,dest=path/to/cache"}, c.Targets[0].CacheTo)
|
||||
require.Equal(t, []string{"default", "key=path/to/key"}, c.Targets[0].SSH)
|
||||
}
|
||||
|
||||
func TestEnv(t *testing.T) {
|
||||
|
150
build/build.go
150
build/build.go
@@ -52,8 +52,8 @@ var (
|
||||
)
|
||||
|
||||
const (
|
||||
//nolint:gosec // G101: false-positive
|
||||
printFallbackImage = "docker/dockerfile:1.5.2-labs@sha256:f2e91734a84c0922ff47aa4098ab775f1dfa932430d2888dd5cad5251fafdac4"
|
||||
printFallbackImage = "docker/dockerfile:1.5@sha256:dbbd5e059e8a07ff7ea6233b213b36aa516b4c53c645f1817a4dd18b83cbea56"
|
||||
printLintFallbackImage = "docker.io/docker/dockerfile-upstream:1.8.1@sha256:e87caa74dcb7d46cd820352bfea12591f3dba3ddc4285e19c7dcd13359f7cefd"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
@@ -88,8 +88,9 @@ type Options struct {
|
||||
}
|
||||
|
||||
type PrintFunc struct {
|
||||
Name string
|
||||
Format string
|
||||
Name string
|
||||
Format string
|
||||
IgnoreStatus bool
|
||||
}
|
||||
|
||||
type Inputs struct {
|
||||
@@ -400,25 +401,8 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
|
||||
|
||||
res, err := c.Solve(ctx, req)
|
||||
if err != nil {
|
||||
fallback := false
|
||||
var reqErr *errdefs.UnsupportedSubrequestError
|
||||
if errors.As(err, &reqErr) {
|
||||
switch reqErr.Name {
|
||||
case "frontend.outline", "frontend.targets":
|
||||
fallback = true
|
||||
default:
|
||||
return nil, err
|
||||
}
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
// buildkit v0.8 vendored in Docker 20.10 does not support typed errors
|
||||
if strings.Contains(err.Error(), "unsupported request frontend.outline") || strings.Contains(err.Error(), "unsupported request frontend.targets") {
|
||||
fallback = true
|
||||
}
|
||||
|
||||
if fallback {
|
||||
req.FrontendOpt["build-arg:BUILDKIT_SYNTAX"] = printFallbackImage
|
||||
req, ok := fallbackPrintError(err, req)
|
||||
if ok {
|
||||
res2, err2 := c.Solve(ctx, req)
|
||||
if err2 != nil {
|
||||
return nil, err
|
||||
@@ -468,7 +452,7 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
|
||||
} else {
|
||||
rr, err = c.Build(ctx, *so, "buildx", buildFunc, ch)
|
||||
}
|
||||
if desktop.BuildBackendEnabled() && node.Driver.HistoryAPISupported(ctx) {
|
||||
if !so.Internal && desktop.BuildBackendEnabled() && node.Driver.HistoryAPISupported(ctx) {
|
||||
if err != nil {
|
||||
return &desktop.ErrorWithBuildRef{
|
||||
Ref: buildRef,
|
||||
@@ -554,7 +538,7 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
|
||||
}
|
||||
|
||||
if pushNames != "" {
|
||||
progress.Write(pw, fmt.Sprintf("merging manifest list %s", pushNames), func() error {
|
||||
err := progress.Write(pw, fmt.Sprintf("merging manifest list %s", pushNames), func() error {
|
||||
descs := make([]specs.Descriptor, 0, len(res))
|
||||
|
||||
for _, r := range res {
|
||||
@@ -623,7 +607,7 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
|
||||
}
|
||||
}
|
||||
|
||||
dt, desc, err := itpull.Combine(ctx, srcs, nil)
|
||||
dt, desc, err := itpull.Combine(ctx, srcs, nil, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -650,6 +634,9 @@ func BuildWithResultHandler(ctx context.Context, nodes []builder.Node, opt map[s
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
@@ -794,11 +781,11 @@ func calculateChildTargets(reqs map[string][]*reqForNode, opt map[string]Options
|
||||
}
|
||||
|
||||
func waitContextDeps(ctx context.Context, index int, results *waitmap.Map, so *client.SolveOpt) error {
|
||||
m := map[string]string{}
|
||||
m := map[string][]string{}
|
||||
for k, v := range so.FrontendAttrs {
|
||||
if strings.HasPrefix(k, "context:") && strings.HasPrefix(v, "target:") {
|
||||
target := resultKey(index, strings.TrimPrefix(v, "target:"))
|
||||
m[target] = k
|
||||
m[target] = append(m[target], k)
|
||||
}
|
||||
}
|
||||
if len(m) == 0 {
|
||||
@@ -813,7 +800,7 @@ func waitContextDeps(ctx context.Context, index int, results *waitmap.Map, so *c
|
||||
return err
|
||||
}
|
||||
|
||||
for k, v := range m {
|
||||
for k, contexts := range m {
|
||||
r, ok := res[k]
|
||||
if !ok {
|
||||
continue
|
||||
@@ -828,19 +815,45 @@ func waitContextDeps(ctx context.Context, index int, results *waitmap.Map, so *c
|
||||
if so.FrontendInputs == nil {
|
||||
so.FrontendInputs = map[string]llb.State{}
|
||||
}
|
||||
if len(rr.Refs) > 0 {
|
||||
for platform, r := range rr.Refs {
|
||||
st, err := r.ToState()
|
||||
|
||||
for _, v := range contexts {
|
||||
if len(rr.Refs) > 0 {
|
||||
for platform, r := range rr.Refs {
|
||||
st, err := r.ToState()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
so.FrontendInputs[k+"::"+platform] = st
|
||||
so.FrontendAttrs[v+"::"+platform] = "input:" + k + "::" + platform
|
||||
metadata := make(map[string][]byte)
|
||||
if dt, ok := rr.Metadata[exptypes.ExporterImageConfigKey+"/"+platform]; ok {
|
||||
metadata[exptypes.ExporterImageConfigKey] = dt
|
||||
}
|
||||
if dt, ok := rr.Metadata["containerimage.buildinfo/"+platform]; ok {
|
||||
metadata["containerimage.buildinfo"] = dt
|
||||
}
|
||||
if len(metadata) > 0 {
|
||||
dt, err := json.Marshal(metadata)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
so.FrontendAttrs["input-metadata:"+k+"::"+platform] = string(dt)
|
||||
}
|
||||
}
|
||||
delete(so.FrontendAttrs, v)
|
||||
}
|
||||
if rr.Ref != nil {
|
||||
st, err := rr.Ref.ToState()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
so.FrontendInputs[k+"::"+platform] = st
|
||||
so.FrontendAttrs[v+"::"+platform] = "input:" + k + "::" + platform
|
||||
so.FrontendInputs[k] = st
|
||||
so.FrontendAttrs[v] = "input:" + k
|
||||
metadata := make(map[string][]byte)
|
||||
if dt, ok := rr.Metadata[exptypes.ExporterImageConfigKey+"/"+platform]; ok {
|
||||
if dt, ok := rr.Metadata[exptypes.ExporterImageConfigKey]; ok {
|
||||
metadata[exptypes.ExporterImageConfigKey] = dt
|
||||
}
|
||||
if dt, ok := rr.Metadata["containerimage.buildinfo/"+platform]; ok {
|
||||
if dt, ok := rr.Metadata["containerimage.buildinfo"]; ok {
|
||||
metadata["containerimage.buildinfo"] = dt
|
||||
}
|
||||
if len(metadata) > 0 {
|
||||
@@ -848,37 +861,54 @@ func waitContextDeps(ctx context.Context, index int, results *waitmap.Map, so *c
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
so.FrontendAttrs["input-metadata:"+k+"::"+platform] = string(dt)
|
||||
so.FrontendAttrs["input-metadata:"+k] = string(dt)
|
||||
}
|
||||
}
|
||||
delete(so.FrontendAttrs, v)
|
||||
}
|
||||
if rr.Ref != nil {
|
||||
st, err := rr.Ref.ToState()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
so.FrontendInputs[k] = st
|
||||
so.FrontendAttrs[v] = "input:" + k
|
||||
metadata := make(map[string][]byte)
|
||||
if dt, ok := rr.Metadata[exptypes.ExporterImageConfigKey]; ok {
|
||||
metadata[exptypes.ExporterImageConfigKey] = dt
|
||||
}
|
||||
if dt, ok := rr.Metadata["containerimage.buildinfo"]; ok {
|
||||
metadata["containerimage.buildinfo"] = dt
|
||||
}
|
||||
if len(metadata) > 0 {
|
||||
dt, err := json.Marshal(metadata)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
so.FrontendAttrs["input-metadata:"+k] = string(dt)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func fallbackPrintError(err error, req gateway.SolveRequest) (gateway.SolveRequest, bool) {
|
||||
if _, ok := req.FrontendOpt["requestid"]; !ok {
|
||||
return req, false
|
||||
}
|
||||
|
||||
fallback := false
|
||||
fallbackLint := false
|
||||
var reqErr *errdefs.UnsupportedSubrequestError
|
||||
if errors.As(err, &reqErr) {
|
||||
switch reqErr.Name {
|
||||
case "frontend.lint":
|
||||
fallbackLint = true
|
||||
fallthrough
|
||||
case "frontend.outline", "frontend.targets":
|
||||
fallback = true
|
||||
default:
|
||||
return req, false
|
||||
}
|
||||
}
|
||||
|
||||
// buildkit v0.8 vendored in Docker 20.10 does not support typed errors
|
||||
for _, req := range []string{"frontend.outline", "frontend.targets", "frontend.lint"} {
|
||||
if strings.Contains(err.Error(), "unsupported request "+req) {
|
||||
fallback = true
|
||||
}
|
||||
if req == "frontend.lint" {
|
||||
fallbackLint = true
|
||||
}
|
||||
}
|
||||
|
||||
if fallback {
|
||||
req.FrontendOpt["build-arg:BUILDKIT_SYNTAX"] = printFallbackImage
|
||||
if fallbackLint {
|
||||
req.FrontendOpt["build-arg:BUILDKIT_SYNTAX"] = printLintFallbackImage
|
||||
}
|
||||
return req, true
|
||||
}
|
||||
return req, false
|
||||
}
|
||||
|
||||
func noPrintFunc(opt map[string]Options) bool {
|
||||
for _, v := range opt {
|
||||
if v.PrintFunc != nil {
|
||||
|
@@ -3,6 +3,7 @@ package build
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/containerd/containerd/platforms"
|
||||
"github.com/docker/buildx/builder"
|
||||
@@ -46,10 +47,22 @@ func (dp resolvedNode) BuildOpts(ctx context.Context) (gateway.BuildOpts, error)
|
||||
|
||||
type matchMaker func(specs.Platform) platforms.MatchComparer
|
||||
|
||||
type cachedGroup[T any] struct {
|
||||
g flightcontrol.Group[T]
|
||||
cache map[int]T
|
||||
cacheMu sync.Mutex
|
||||
}
|
||||
|
||||
func newCachedGroup[T any]() cachedGroup[T] {
|
||||
return cachedGroup[T]{
|
||||
cache: map[int]T{},
|
||||
}
|
||||
}
|
||||
|
||||
type nodeResolver struct {
|
||||
nodes []builder.Node
|
||||
clients flightcontrol.Group[*client.Client]
|
||||
opt flightcontrol.Group[gateway.BuildOpts]
|
||||
nodes []builder.Node
|
||||
clients cachedGroup[*client.Client]
|
||||
buildOpts cachedGroup[gateway.BuildOpts]
|
||||
}
|
||||
|
||||
func resolveDrivers(ctx context.Context, nodes []builder.Node, opt map[string]Options, pw progress.Writer) (map[string][]*resolvedNode, error) {
|
||||
@@ -63,7 +76,9 @@ func resolveDrivers(ctx context.Context, nodes []builder.Node, opt map[string]Op
|
||||
|
||||
func newDriverResolver(nodes []builder.Node) *nodeResolver {
|
||||
r := &nodeResolver{
|
||||
nodes: nodes,
|
||||
nodes: nodes,
|
||||
clients: newCachedGroup[*client.Client](),
|
||||
buildOpts: newCachedGroup[gateway.BuildOpts](),
|
||||
}
|
||||
return r
|
||||
}
|
||||
@@ -179,6 +194,7 @@ func (r *nodeResolver) resolve(ctx context.Context, ps []specs.Platform, pw prog
|
||||
resolver: r,
|
||||
driverIndex: 0,
|
||||
})
|
||||
nodeIdxs = append(nodeIdxs, 0)
|
||||
} else {
|
||||
for i, idx := range nodeIdxs {
|
||||
node := &resolvedNode{
|
||||
@@ -237,11 +253,24 @@ func (r *nodeResolver) boot(ctx context.Context, idxs []int, pw progress.Writer)
|
||||
for i, idx := range idxs {
|
||||
i, idx := i, idx
|
||||
eg.Go(func() error {
|
||||
c, err := r.clients.Do(ctx, fmt.Sprint(idx), func(ctx context.Context) (*client.Client, error) {
|
||||
c, err := r.clients.g.Do(ctx, fmt.Sprint(idx), func(ctx context.Context) (*client.Client, error) {
|
||||
if r.nodes[idx].Driver == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return driver.Boot(ctx, baseCtx, r.nodes[idx].Driver, pw)
|
||||
r.clients.cacheMu.Lock()
|
||||
c, ok := r.clients.cache[idx]
|
||||
r.clients.cacheMu.Unlock()
|
||||
if ok {
|
||||
return c, nil
|
||||
}
|
||||
c, err := driver.Boot(ctx, baseCtx, r.nodes[idx].Driver, pw)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
r.clients.cacheMu.Lock()
|
||||
r.clients.cache[idx] = c
|
||||
r.clients.cacheMu.Unlock()
|
||||
return c, nil
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -272,14 +301,25 @@ func (r *nodeResolver) opts(ctx context.Context, idxs []int, pw progress.Writer)
|
||||
continue
|
||||
}
|
||||
eg.Go(func() error {
|
||||
opt, err := r.opt.Do(ctx, fmt.Sprint(idx), func(ctx context.Context) (gateway.BuildOpts, error) {
|
||||
opt := gateway.BuildOpts{}
|
||||
opt, err := r.buildOpts.g.Do(ctx, fmt.Sprint(idx), func(ctx context.Context) (gateway.BuildOpts, error) {
|
||||
r.buildOpts.cacheMu.Lock()
|
||||
opt, ok := r.buildOpts.cache[idx]
|
||||
r.buildOpts.cacheMu.Unlock()
|
||||
if ok {
|
||||
return opt, nil
|
||||
}
|
||||
_, err := c.Build(ctx, client.SolveOpt{
|
||||
Internal: true,
|
||||
}, "buildx", func(ctx context.Context, c gateway.Client) (*gateway.Result, error) {
|
||||
opt = c.BuildOpts()
|
||||
return nil, nil
|
||||
}, nil)
|
||||
if err != nil {
|
||||
return gateway.BuildOpts{}, err
|
||||
}
|
||||
r.buildOpts.cacheMu.Lock()
|
||||
r.buildOpts.cache[idx] = opt
|
||||
r.buildOpts.cacheMu.Unlock()
|
||||
return opt, err
|
||||
})
|
||||
if err != nil {
|
||||
|
@@ -37,7 +37,7 @@ func NewContainer(ctx context.Context, resultCtx *ResultHandle, cfg *controllera
|
||||
cancel()
|
||||
}()
|
||||
|
||||
containerCfg, err := resultCtx.getContainerConfig(ctx, c, cfg)
|
||||
containerCfg, err := resultCtx.getContainerConfig(cfg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
83
build/opt.go
83
build/opt.go
@@ -20,7 +20,6 @@ import (
|
||||
"github.com/docker/buildx/util/dockerutil"
|
||||
"github.com/docker/buildx/util/osutil"
|
||||
"github.com/docker/buildx/util/progress"
|
||||
"github.com/docker/docker/builder/remotecontext/urlutil"
|
||||
"github.com/moby/buildkit/client"
|
||||
"github.com/moby/buildkit/client/llb"
|
||||
"github.com/moby/buildkit/client/ociindex"
|
||||
@@ -162,7 +161,7 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
|
||||
case 1:
|
||||
// valid
|
||||
case 0:
|
||||
if !noDefaultLoad() {
|
||||
if !noDefaultLoad() && opt.PrintFunc == nil {
|
||||
if nodeDriver.IsMobyDriver() {
|
||||
// backwards compat for docker driver only:
|
||||
// this ensures the build results in a docker image.
|
||||
@@ -354,6 +353,11 @@ func toSolveOpt(ctx context.Context, node builder.Node, multiDriver bool, opt Op
|
||||
so.FrontendAttrs["ulimit"] = ulimits
|
||||
}
|
||||
|
||||
// mark info request as internal
|
||||
if opt.PrintFunc != nil {
|
||||
so.Internal = true
|
||||
}
|
||||
|
||||
return &so, releaseF, nil
|
||||
}
|
||||
|
||||
@@ -447,7 +451,7 @@ func loadInputs(ctx context.Context, d *driver.DriverHandle, inp Inputs, addVCSL
|
||||
dockerfileName = "Dockerfile"
|
||||
target.FrontendAttrs["dockerfilekey"] = "dockerfile"
|
||||
}
|
||||
if urlutil.IsURL(inp.DockerfilePath) {
|
||||
if isHTTPURL(inp.DockerfilePath) {
|
||||
dockerfileDir, err = createTempDockerfileFromURL(ctx, d, inp.DockerfilePath, pw)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -489,45 +493,18 @@ func loadInputs(ctx context.Context, d *driver.DriverHandle, inp Inputs, addVCSL
|
||||
|
||||
// handle OCI layout
|
||||
if strings.HasPrefix(v.Path, "oci-layout://") {
|
||||
pathAlone := strings.TrimPrefix(v.Path, "oci-layout://")
|
||||
localPath := pathAlone
|
||||
localPath := strings.TrimPrefix(v.Path, "oci-layout://")
|
||||
localPath, dig, hasDigest := strings.Cut(localPath, "@")
|
||||
localPath, tag, hasTag := strings.Cut(localPath, ":")
|
||||
if !hasTag {
|
||||
tag = "latest"
|
||||
hasTag = true
|
||||
}
|
||||
idx := ociindex.NewStoreIndex(localPath)
|
||||
if !hasDigest {
|
||||
// lookup by name
|
||||
desc, err := idx.Get(tag)
|
||||
dig, err = resolveDigest(localPath, tag)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if desc != nil {
|
||||
dig = string(desc.Digest)
|
||||
hasDigest = true
|
||||
return nil, errors.Wrapf(err, "oci-layout reference %q could not be resolved", v.Path)
|
||||
}
|
||||
}
|
||||
if !hasDigest {
|
||||
// lookup single
|
||||
desc, err := idx.GetSingle()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if desc != nil {
|
||||
dig = string(desc.Digest)
|
||||
hasDigest = true
|
||||
}
|
||||
}
|
||||
if !hasDigest {
|
||||
return nil, errors.Errorf("oci-layout reference %q could not be resolved", v.Path)
|
||||
}
|
||||
_, err := digest.Parse(dig)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "invalid oci-layout digest %s", dig)
|
||||
}
|
||||
|
||||
store, err := local.NewStore(localPath)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "invalid store at %s", localPath)
|
||||
@@ -538,15 +515,7 @@ func loadInputs(ctx context.Context, d *driver.DriverHandle, inp Inputs, addVCSL
|
||||
}
|
||||
target.OCIStores[storeName] = store
|
||||
|
||||
layout := "oci-layout://" + storeName
|
||||
if hasTag {
|
||||
layout += ":" + tag
|
||||
}
|
||||
if hasDigest {
|
||||
layout += "@" + dig
|
||||
}
|
||||
|
||||
target.FrontendAttrs["context:"+k] = layout
|
||||
target.FrontendAttrs["context:"+k] = "oci-layout://" + storeName + ":" + tag + "@" + dig
|
||||
continue
|
||||
}
|
||||
st, err := os.Stat(v.Path)
|
||||
@@ -568,12 +537,40 @@ func loadInputs(ctx context.Context, d *driver.DriverHandle, inp Inputs, addVCSL
|
||||
|
||||
release := func() {
|
||||
for _, dir := range toRemove {
|
||||
os.RemoveAll(dir)
|
||||
_ = os.RemoveAll(dir)
|
||||
}
|
||||
}
|
||||
return release, nil
|
||||
}
|
||||
|
||||
func resolveDigest(localPath, tag string) (dig string, _ error) {
|
||||
idx := ociindex.NewStoreIndex(localPath)
|
||||
|
||||
// lookup by name
|
||||
desc, err := idx.Get(tag)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if desc == nil {
|
||||
// lookup single
|
||||
desc, err = idx.GetSingle()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
if desc == nil {
|
||||
return "", errors.New("failed to resolve digest")
|
||||
}
|
||||
|
||||
dig = string(desc.Digest)
|
||||
_, err = digest.Parse(dig)
|
||||
if err != nil {
|
||||
return "", errors.Wrapf(err, "invalid digest %s", dig)
|
||||
}
|
||||
|
||||
return dig, nil
|
||||
}
|
||||
|
||||
func setLocalMount(name, root string, so *client.SolveOpt, addVCSLocalDir func(key, dir string, so *client.SolveOpt)) error {
|
||||
lm, err := fsutil.NewFS(root)
|
||||
if err != nil {
|
||||
|
@@ -292,10 +292,10 @@ func (r *ResultHandle) build(buildFunc gateway.BuildFunc) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *ResultHandle) getContainerConfig(ctx context.Context, c gateway.Client, cfg *controllerapi.InvokeConfig) (containerCfg gateway.NewContainerRequest, _ error) {
|
||||
func (r *ResultHandle) getContainerConfig(cfg *controllerapi.InvokeConfig) (containerCfg gateway.NewContainerRequest, _ error) {
|
||||
if r.res != nil && r.solveErr == nil {
|
||||
logrus.Debugf("creating container from successful build")
|
||||
ccfg, err := containerConfigFromResult(ctx, r.res, c, *cfg)
|
||||
ccfg, err := containerConfigFromResult(r.res, *cfg)
|
||||
if err != nil {
|
||||
return containerCfg, err
|
||||
}
|
||||
@@ -327,7 +327,7 @@ func (r *ResultHandle) getProcessConfig(cfg *controllerapi.InvokeConfig, stdin i
|
||||
return processCfg, nil
|
||||
}
|
||||
|
||||
func containerConfigFromResult(ctx context.Context, res *gateway.Result, c gateway.Client, cfg controllerapi.InvokeConfig) (*gateway.NewContainerRequest, error) {
|
||||
func containerConfigFromResult(res *gateway.Result, cfg controllerapi.InvokeConfig) (*gateway.NewContainerRequest, error) {
|
||||
if cfg.Initial {
|
||||
return nil, errors.Errorf("starting from the container from the initial state of the step is supported only on the failed steps")
|
||||
}
|
||||
|
@@ -11,7 +11,6 @@ import (
|
||||
|
||||
"github.com/docker/buildx/driver"
|
||||
"github.com/docker/cli/opts"
|
||||
"github.com/docker/docker/builder/remotecontext/urlutil"
|
||||
"github.com/moby/buildkit/util/gitutil"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -26,8 +25,15 @@ const (
|
||||
mobyHostGatewayName = "host-gateway"
|
||||
)
|
||||
|
||||
// isHTTPURL returns true if the provided str is an HTTP(S) URL by checking if it
|
||||
// has a http:// or https:// scheme. No validation is performed to verify if the
|
||||
// URL is well-formed.
|
||||
func isHTTPURL(str string) bool {
|
||||
return strings.HasPrefix(str, "https://") || strings.HasPrefix(str, "http://")
|
||||
}
|
||||
|
||||
func IsRemoteURL(c string) bool {
|
||||
if urlutil.IsURL(c) {
|
||||
if isHTTPURL(c) {
|
||||
return true
|
||||
}
|
||||
if _, err := gitutil.ParseGitRef(c); err == nil {
|
||||
|
@@ -186,7 +186,7 @@ func (b *Builder) LoadNodes(ctx context.Context, opts ...LoadNodesOption) (_ []N
|
||||
if pl := di.DriverInfo.DynamicNodes[i].Platforms; len(pl) > 0 {
|
||||
diClone.Platforms = pl
|
||||
}
|
||||
nodes = append(nodes, di)
|
||||
nodes = append(nodes, diClone)
|
||||
}
|
||||
dynamicNodes = append(dynamicNodes, di.DriverInfo.DynamicNodes...)
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
@@ -15,6 +16,7 @@ import (
|
||||
cliflags "github.com/docker/cli/cli/flags"
|
||||
"github.com/moby/buildkit/solver/errdefs"
|
||||
"github.com/moby/buildkit/util/stack"
|
||||
"go.opentelemetry.io/otel"
|
||||
|
||||
//nolint:staticcheck // vendored dependencies may still use this
|
||||
"github.com/containerd/containerd/pkg/seed"
|
||||
@@ -38,10 +40,27 @@ func runStandalone(cmd *command.DockerCli) error {
|
||||
if err := cmd.Initialize(cliflags.NewClientOptions()); err != nil {
|
||||
return err
|
||||
}
|
||||
defer flushMetrics(cmd)
|
||||
|
||||
rootCmd := commands.NewRootCmd(os.Args[0], false, cmd)
|
||||
return rootCmd.Execute()
|
||||
}
|
||||
|
||||
// flushMetrics will manually flush metrics from the configured
|
||||
// meter provider. This is needed when running in standalone mode
|
||||
// because the meter provider is initialized by the cli library,
|
||||
// but the mechanism for forcing it to report is not presently
|
||||
// exposed and not invoked when run in standalone mode.
|
||||
// There are plans to fix that in the next release, but this is
|
||||
// needed temporarily until the API for this is more thorough.
|
||||
func flushMetrics(cmd *command.DockerCli) {
|
||||
if mp, ok := cmd.MeterProvider().(command.MeterProvider); ok {
|
||||
if err := mp.ForceFlush(context.Background()); err != nil {
|
||||
otel.Handle(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func runPlugin(cmd *command.DockerCli) error {
|
||||
rootCmd := commands.NewRootCmd("buildx", true, cmd)
|
||||
return plugin.RunPlugin(cmd, rootCmd, manager.Metadata{
|
||||
|
@@ -4,7 +4,6 @@ import (
|
||||
"github.com/moby/buildkit/util/tracing/detect"
|
||||
"go.opentelemetry.io/otel"
|
||||
|
||||
_ "github.com/moby/buildkit/util/tracing/detect/delegated"
|
||||
_ "github.com/moby/buildkit/util/tracing/env"
|
||||
)
|
||||
|
||||
|
@@ -122,27 +122,26 @@ func (o *buildOptions) toControllerOptions() (*controllerapi.BuildOptions, error
|
||||
}
|
||||
|
||||
opts := controllerapi.BuildOptions{
|
||||
Allow: o.allow,
|
||||
Annotations: o.annotations,
|
||||
BuildArgs: buildArgs,
|
||||
CgroupParent: o.cgroupParent,
|
||||
ContextPath: o.contextPath,
|
||||
DockerfileName: o.dockerfileName,
|
||||
ExtraHosts: o.extraHosts,
|
||||
Labels: labels,
|
||||
NetworkMode: o.networkMode,
|
||||
NoCacheFilter: o.noCacheFilter,
|
||||
Platforms: o.platforms,
|
||||
ShmSize: int64(o.shmSize),
|
||||
Tags: o.tags,
|
||||
Target: o.target,
|
||||
Ulimits: dockerUlimitToControllerUlimit(o.ulimits),
|
||||
Builder: o.builder,
|
||||
NoCache: o.noCache,
|
||||
Pull: o.pull,
|
||||
ExportPush: o.exportPush,
|
||||
ExportLoad: o.exportLoad,
|
||||
WithProvenanceResponse: len(o.metadataFile) > 0,
|
||||
Allow: o.allow,
|
||||
Annotations: o.annotations,
|
||||
BuildArgs: buildArgs,
|
||||
CgroupParent: o.cgroupParent,
|
||||
ContextPath: o.contextPath,
|
||||
DockerfileName: o.dockerfileName,
|
||||
ExtraHosts: o.extraHosts,
|
||||
Labels: labels,
|
||||
NetworkMode: o.networkMode,
|
||||
NoCacheFilter: o.noCacheFilter,
|
||||
Platforms: o.platforms,
|
||||
ShmSize: int64(o.shmSize),
|
||||
Tags: o.tags,
|
||||
Target: o.target,
|
||||
Ulimits: dockerUlimitToControllerUlimit(o.ulimits),
|
||||
Builder: o.builder,
|
||||
NoCache: o.noCache,
|
||||
Pull: o.pull,
|
||||
ExportPush: o.exportPush,
|
||||
ExportLoad: o.exportLoad,
|
||||
}
|
||||
|
||||
// TODO: extract env var parsing to a method easily usable by library consumers
|
||||
@@ -207,6 +206,8 @@ func (o *buildOptions) toControllerOptions() (*controllerapi.BuildOptions, error
|
||||
return nil, err
|
||||
}
|
||||
|
||||
opts.WithProvenanceResponse = opts.PrintFunc == nil && len(o.metadataFile) > 0
|
||||
|
||||
return &opts, nil
|
||||
}
|
||||
|
||||
@@ -268,8 +269,7 @@ func (o *buildOptionsHash) String() string {
|
||||
}
|
||||
|
||||
func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions) (err error) {
|
||||
mp := dockerCli.MeterProvider(ctx)
|
||||
defer metricutil.Shutdown(ctx, mp)
|
||||
mp := dockerCli.MeterProvider()
|
||||
|
||||
ctx, end, err := tracing.TraceCurrentCommand(ctx, "build")
|
||||
if err != nil {
|
||||
@@ -340,7 +340,7 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions)
|
||||
if confutil.IsExperimental() {
|
||||
resp, retErr = runControllerBuild(ctx, dockerCli, opts, options, printer)
|
||||
} else {
|
||||
resp, retErr = runBasicBuild(ctx, dockerCli, opts, options, printer)
|
||||
resp, retErr = runBasicBuild(ctx, dockerCli, opts, printer)
|
||||
}
|
||||
|
||||
if err := printer.Wait(); retErr == nil {
|
||||
@@ -365,15 +365,14 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions)
|
||||
return errors.Wrap(err, "writing image ID file")
|
||||
}
|
||||
}
|
||||
if options.metadataFile != "" {
|
||||
if err := writeMetadataFile(options.metadataFile, decodeExporterResponse(resp.ExporterResponse)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if opts.PrintFunc != nil {
|
||||
if err := printResult(opts.PrintFunc, resp.ExporterResponse); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if options.metadataFile != "" {
|
||||
if err := writeMetadataFile(options.metadataFile, decodeExporterResponse(resp.ExporterResponse)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -387,7 +386,7 @@ func getImageID(resp map[string]string) string {
|
||||
return dgst
|
||||
}
|
||||
|
||||
func runBasicBuild(ctx context.Context, dockerCli command.Cli, opts *controllerapi.BuildOptions, options buildOptions, printer *progress.Printer) (*client.SolveResponse, error) {
|
||||
func runBasicBuild(ctx context.Context, dockerCli command.Cli, opts *controllerapi.BuildOptions, printer *progress.Printer) (*client.SolveResponse, error) {
|
||||
resp, res, err := cbuild.RunBuild(ctx, dockerCli, *opts, dockerCli.In(), printer, false)
|
||||
if res != nil {
|
||||
res.Done()
|
||||
@@ -598,11 +597,6 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions, debugConfig *debug.D
|
||||
|
||||
flags.StringArrayVar(&options.platforms, "platform", platformsDefault, "Set target platform for build")
|
||||
|
||||
if confutil.IsExperimental() {
|
||||
flags.StringVar(&options.printFunc, "print", "", "Print result of information request (e.g., outline, targets)")
|
||||
cobrautil.MarkFlagsExperimental(flags, "print")
|
||||
}
|
||||
|
||||
flags.BoolVar(&options.exportPush, "push", false, `Shorthand for "--output=type=registry"`)
|
||||
|
||||
flags.BoolVarP(&options.quiet, "quiet", "q", false, "Suppress the build output and print image ID on success")
|
||||
@@ -634,12 +628,20 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions, debugConfig *debug.D
|
||||
cobrautil.MarkFlagsExperimental(flags, "root", "detach", "server-config")
|
||||
}
|
||||
|
||||
flags.StringVar(&options.printFunc, "call", "build", `Set method for evaluating build ("check", "outline", "targets")`)
|
||||
flags.VarPF(callAlias(options, "check"), "check", "", `Shorthand for "--call=check"`)
|
||||
flags.Lookup("check").NoOptDefVal = "true"
|
||||
|
||||
// hidden flags
|
||||
var ignore string
|
||||
var ignoreSlice []string
|
||||
var ignoreBool bool
|
||||
var ignoreInt int64
|
||||
|
||||
flags.StringVar(&options.printFunc, "print", "", "Print result of information request (e.g., outline, targets)")
|
||||
cobrautil.MarkFlagsExperimental(flags, "print")
|
||||
flags.MarkHidden("print")
|
||||
|
||||
flags.BoolVar(&ignoreBool, "compress", false, "Compress the build context using gzip")
|
||||
flags.MarkHidden("compress")
|
||||
|
||||
@@ -697,7 +699,7 @@ type commonFlags struct {
|
||||
|
||||
func commonBuildFlags(options *commonFlags, flags *pflag.FlagSet) {
|
||||
options.noCache = flags.Bool("no-cache", false, "Do not use cache when building the image")
|
||||
flags.StringVar(&options.progress, "progress", "auto", `Set type of progress output ("auto", "plain", "tty"). Use plain to show container output`)
|
||||
flags.StringVar(&options.progress, "progress", "auto", `Set type of progress output ("auto", "plain", "tty", "rawjson"). Use plain to show container output`)
|
||||
options.pull = flags.Bool("pull", false, "Always attempt to pull all referenced images")
|
||||
flags.StringVar(&options.metadataFile, "metadata-file", "", "Write build result metadata to a file")
|
||||
}
|
||||
@@ -864,7 +866,34 @@ func printResult(f *controllerapi.PrintFunc, res map[string]string) error {
|
||||
case "subrequests.describe":
|
||||
return printValue(subrequests.PrintDescribe, subrequests.SubrequestsDescribeDefinition.Version, f.Format, res)
|
||||
case "lint":
|
||||
return printValue(lint.PrintLintViolations, lint.SubrequestLintDefinition.Version, f.Format, res)
|
||||
err := printValue(lint.PrintLintViolations, lint.SubrequestLintDefinition.Version, f.Format, res)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
lintResults := lint.LintResults{}
|
||||
if result, ok := res["result.json"]; ok {
|
||||
if err := json.Unmarshal([]byte(result), &lintResults); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if lintResults.Error != nil {
|
||||
// Print the error message and the source
|
||||
// Normally, we would use `errdefs.WithSource` to attach the source to the
|
||||
// error and let the error be printed by the handling that's already in place,
|
||||
// but here we want to print the error in a way that's consistent with how
|
||||
// the lint warnings are printed via the `lint.PrintLintViolations` function,
|
||||
// which differs from the default error printing.
|
||||
fmt.Println()
|
||||
lintBuf := bytes.NewBuffer([]byte(lintResults.Error.Message + "\n"))
|
||||
sourceInfo := lintResults.Sources[lintResults.Error.Location.SourceIndex]
|
||||
source := errdefs.Source{
|
||||
Info: sourceInfo,
|
||||
Ranges: lintResults.Error.Location.Ranges,
|
||||
}
|
||||
source.Print(lintBuf)
|
||||
return errors.New(lintBuf.String())
|
||||
}
|
||||
default:
|
||||
if dt, ok := res["result.json"]; ok && f.Format == "json" {
|
||||
fmt.Println(dt)
|
||||
@@ -874,6 +903,11 @@ func printResult(f *controllerapi.PrintFunc, res map[string]string) error {
|
||||
log.Printf("%s %+v", f, res)
|
||||
}
|
||||
}
|
||||
if v, ok := res["result.statuscode"]; !f.IgnoreStatus && ok {
|
||||
if n, err := strconv.Atoi(v); err == nil && n != 0 {
|
||||
os.Exit(n)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -998,6 +1032,20 @@ func maybeJSONArray(v string) []string {
|
||||
return []string{v}
|
||||
}
|
||||
|
||||
func callAlias(options *buildOptions, value string) cobrautil.BoolFuncValue {
|
||||
return func(s string) error {
|
||||
v, err := strconv.ParseBool(s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if v {
|
||||
options.printFunc = value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// timeBuildCommand will start a timer for timing the build command. It records the time when the returned
|
||||
// function is invoked into a metric.
|
||||
func timeBuildCommand(mp metric.MeterProvider, attrs attribute.Set) func(err error) {
|
||||
|
@@ -80,7 +80,7 @@ func RootCmd(dockerCli command.Cli, children ...DebuggableCmd) *cobra.Command {
|
||||
flags.StringVar(&controlOptions.Root, "root", "", "Specify root directory of server to connect for the monitor")
|
||||
flags.BoolVar(&controlOptions.Detach, "detach", runtime.GOOS == "linux", "Detach buildx server for the monitor (supported only on linux)")
|
||||
flags.StringVar(&controlOptions.ServerConfig, "server-config", "", "Specify buildx server config file for the monitor (used only when launching new server)")
|
||||
flags.StringVar(&progressMode, "progress", "auto", `Set type of progress output ("auto", "plain", "tty") for the monitor. Use plain to show container output`)
|
||||
flags.StringVar(&progressMode, "progress", "auto", `Set type of progress output ("auto", "plain", "tty", "rawjson") for the monitor. Use plain to show container output`)
|
||||
|
||||
cobrautil.MarkFlagsExperimental(flags, "invoke", "on", "root", "detach", "server-config")
|
||||
|
||||
|
@@ -125,8 +125,7 @@ func dialStdioCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command {
|
||||
}
|
||||
|
||||
flags := cmd.Flags()
|
||||
cmd.Flags()
|
||||
flags.StringVar(&opts.platform, "platform", os.Getenv("DOCKER_DEFAULT_PLATFORM"), "Target platform: this is used for node selection")
|
||||
flags.StringVar(&opts.progress, "progress", "quiet", "Set type of progress output (auto, plain, tty).")
|
||||
flags.StringVar(&opts.progress, "progress", "quiet", `Set type of progress output ("auto", "plain", "tty", "rawjson"). Use plain to show container output`)
|
||||
return cmd
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@ type createOptions struct {
|
||||
dryrun bool
|
||||
actionAppend bool
|
||||
progress string
|
||||
preferIndex bool
|
||||
}
|
||||
|
||||
func runCreate(ctx context.Context, dockerCli command.Cli, in createOptions, args []string) error {
|
||||
@@ -153,7 +154,7 @@ func runCreate(ctx context.Context, dockerCli command.Cli, in createOptions, arg
|
||||
}
|
||||
}
|
||||
|
||||
dt, desc, err := r.Combine(ctx, srcs, in.annotations)
|
||||
dt, desc, err := r.Combine(ctx, srcs, in.annotations, in.preferIndex)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -281,8 +282,9 @@ func createCmd(dockerCli command.Cli, opts RootOptions) *cobra.Command {
|
||||
flags.StringArrayVarP(&options.tags, "tag", "t", []string{}, "Set reference for new image")
|
||||
flags.BoolVar(&options.dryrun, "dry-run", false, "Show final image instead of pushing")
|
||||
flags.BoolVar(&options.actionAppend, "append", false, "Append to existing manifest")
|
||||
flags.StringVar(&options.progress, "progress", "auto", `Set type of progress output ("auto", "plain", "tty"). Use plain to show container output`)
|
||||
flags.StringVar(&options.progress, "progress", "auto", `Set type of progress output ("auto", "plain", "tty", "rawjson"). Use plain to show container output`)
|
||||
flags.StringArrayVarP(&options.annotations, "annotation", "", []string{}, "Add annotation to the image")
|
||||
flags.BoolVar(&options.preferIndex, "prefer-index", true, "When only a single source is specified, prefer outputting an image index or manifest list instead of performing a carbon copy")
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ import (
|
||||
type installOptions struct {
|
||||
}
|
||||
|
||||
func runInstall(dockerCli command.Cli, in installOptions) error {
|
||||
func runInstall(_ command.Cli, _ installOptions) error {
|
||||
dir := config.Dir()
|
||||
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||
return errors.Wrap(err, "could not create docker config")
|
||||
|
@@ -195,6 +195,8 @@ func toBuildkitPruneInfo(f filters.Args) (*client.PruneInfo, error) {
|
||||
case 1:
|
||||
if filterKey == "id" {
|
||||
filters = append(filters, filterKey+"~="+values[0])
|
||||
} else if strings.HasSuffix(filterKey, "!") || strings.HasSuffix(filterKey, "~") {
|
||||
filters = append(filters, filterKey+"="+values[0])
|
||||
} else {
|
||||
filters = append(filters, filterKey+"=="+values[0])
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ import (
|
||||
type uninstallOptions struct {
|
||||
}
|
||||
|
||||
func runUninstall(dockerCli command.Cli, in uninstallOptions) error {
|
||||
func runUninstall(_ command.Cli, _ uninstallOptions) error {
|
||||
dir := config.Dir()
|
||||
cfg, err := config.Load(dir)
|
||||
if err != nil {
|
||||
|
@@ -11,7 +11,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func runVersion(dockerCli command.Cli) error {
|
||||
func runVersion(_ command.Cli) error {
|
||||
fmt.Println(version.Package, version.Version, version.Revision)
|
||||
return nil
|
||||
}
|
||||
|
@@ -161,8 +161,9 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build
|
||||
|
||||
if in.PrintFunc != nil {
|
||||
opts.PrintFunc = &build.PrintFunc{
|
||||
Name: in.PrintFunc.Name,
|
||||
Format: in.PrintFunc.Format,
|
||||
Name: in.PrintFunc.Name,
|
||||
Format: in.PrintFunc.Format,
|
||||
IgnoreStatus: in.PrintFunc.IgnoreStatus,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +189,7 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
resp, res, err := buildTargets(ctx, dockerCli, b.NodeGroup, nodes, map[string]build.Options{defaultTargetName: opts}, progress, generateResult)
|
||||
resp, res, err := buildTargets(ctx, dockerCli, nodes, map[string]build.Options{defaultTargetName: opts}, progress, generateResult)
|
||||
err = wrapBuildError(err, false)
|
||||
if err != nil {
|
||||
// NOTE: buildTargets can return *build.ResultHandle even on error.
|
||||
@@ -202,7 +203,7 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build
|
||||
// NOTE: When an error happens during the build and this function acquires the debuggable *build.ResultHandle,
|
||||
// this function returns it in addition to the error (i.e. it does "return nil, res, err"). The caller can
|
||||
// inspect the result and debug the cause of that error.
|
||||
func buildTargets(ctx context.Context, dockerCli command.Cli, ng *store.NodeGroup, nodes []builder.Node, opts map[string]build.Options, progress progress.Writer, generateResult bool) (*client.SolveResponse, *build.ResultHandle, error) {
|
||||
func buildTargets(ctx context.Context, dockerCli command.Cli, nodes []builder.Node, opts map[string]build.Options, progress progress.Writer, generateResult bool) (*client.SolveResponse, *build.ResultHandle, error) {
|
||||
var res *build.ResultHandle
|
||||
var resp map[string]*client.SolveResponse
|
||||
var err error
|
||||
|
@@ -813,6 +813,7 @@ func (m *Secret) GetEnv() string {
|
||||
type PrintFunc struct {
|
||||
Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
|
||||
Format string `protobuf:"bytes,2,opt,name=Format,proto3" json:"Format,omitempty"`
|
||||
IgnoreStatus bool `protobuf:"varint,3,opt,name=IgnoreStatus,proto3" json:"IgnoreStatus,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
@@ -856,6 +857,13 @@ func (m *PrintFunc) GetFormat() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *PrintFunc) GetIgnoreStatus() bool {
|
||||
if m != nil {
|
||||
return m.IgnoreStatus
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type InspectRequest struct {
|
||||
Ref string `protobuf:"bytes,1,opt,name=Ref,proto3" json:"Ref,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
@@ -2086,129 +2094,130 @@ func init() {
|
||||
func init() { proto.RegisterFile("controller.proto", fileDescriptor_ed7f10298fa1d90f) }
|
||||
|
||||
var fileDescriptor_ed7f10298fa1d90f = []byte{
|
||||
// 1946 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0x5f, 0x53, 0x1b, 0xc9,
|
||||
0x11, 0xcf, 0x4a, 0x42, 0x7f, 0x5a, 0x08, 0xe3, 0x09, 0x76, 0xc6, 0x6b, 0x9f, 0x8d, 0xd7, 0xf6,
|
||||
0x45, 0x15, 0xa7, 0xc4, 0x1d, 0x17, 0x1f, 0xe7, 0xf3, 0x5d, 0x55, 0x40, 0xa0, 0xc0, 0x95, 0x0d,
|
||||
0xd4, 0x0a, 0xdb, 0x95, 0xa4, 0x2a, 0xae, 0x45, 0x1a, 0xc4, 0x16, 0xcb, 0x8e, 0xb2, 0x33, 0x12,
|
||||
0x28, 0x4f, 0x79, 0x48, 0xde, 0x52, 0xf9, 0x1e, 0xa9, 0x7c, 0x84, 0x3c, 0xe5, 0x2d, 0x1f, 0x27,
|
||||
0x1f, 0x21, 0x35, 0x3d, 0xb3, 0xab, 0x15, 0xd2, 0x0a, 0xc8, 0x3d, 0x69, 0xba, 0xf7, 0xd7, 0xdd,
|
||||
0xd3, 0x3d, 0x3d, 0xdd, 0x3d, 0x82, 0xe5, 0x0e, 0x0f, 0x65, 0xc4, 0x83, 0x80, 0x45, 0x8d, 0x7e,
|
||||
0xc4, 0x25, 0x27, 0x2b, 0xc7, 0x03, 0x3f, 0xe8, 0x5e, 0x36, 0x52, 0x1f, 0x86, 0x5f, 0xda, 0x6f,
|
||||
0x7a, 0xbe, 0x3c, 0x1d, 0x1c, 0x37, 0x3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0xf4, 0x3a, 0xa7, 0xac, 0x15, 0xf1, 0x73, 0x5a, 0x46, 0x85, 0x3f, 0x9f, 0xad, 0x10, 0x61,
|
||||
0x46, 0xa1, 0x51, 0x93, 0x48, 0x92, 0x4d, 0x28, 0x21, 0x71, 0xc4, 0x69, 0xe5, 0x76, 0x4a, 0x62,
|
||||
0x39, 0xe2, 0xc0, 0x62, 0xb3, 0x17, 0xf1, 0x41, 0xff, 0xd0, 0x8b, 0x58, 0x28, 0x29, 0xe0, 0x51,
|
||||
0x4f, 0xf0, 0xc8, 0x1b, 0x28, 0xed, 0x5c, 0xf6, 0x79, 0x24, 0x05, 0xad, 0xce, 0xbb, 0xbc, 0x1a,
|
||||
0x64, 0x0c, 0x18, 0x09, 0xf2, 0x18, 0x60, 0xe7, 0x52, 0x46, 0xde, 0x2e, 0x57, 0x61, 0x5f, 0xc4,
|
||||
0xe3, 0x48, 0x71, 0x48, 0x0b, 0x8a, 0x6f, 0xbd, 0x63, 0x16, 0x08, 0x5a, 0x43, 0xdd, 0x8d, 0x1b,
|
||||
0x04, 0x56, 0x0b, 0x68, 0x43, 0x46, 0x5a, 0xe5, 0xf5, 0x3e, 0x93, 0x17, 0x3c, 0x3a, 0x7b, 0xc7,
|
||||
0xbb, 0x8c, 0x2e, 0xe9, 0xbc, 0x4e, 0xb1, 0xc8, 0x73, 0xa8, 0xed, 0x73, 0x1d, 0x3c, 0x3f, 0x90,
|
||||
0x2c, 0xa2, 0x77, 0x70, 0x33, 0x93, 0x4c, 0xbc, 0xcb, 0x81, 0x27, 0x4f, 0x78, 0x74, 0x2e, 0xe8,
|
||||
0x32, 0x22, 0xc6, 0x0c, 0x95, 0x41, 0x6d, 0xd6, 0x89, 0x98, 0x14, 0xf4, 0xee, 0xbc, 0x0c, 0xd2,
|
||||
0x20, 0x37, 0x06, 0x13, 0x0a, 0xa5, 0xf6, 0xe9, 0x79, 0xdb, 0xff, 0x13, 0xa3, 0x64, 0xd5, 0xaa,
|
||||
0xe7, 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0xd9, 0xad, 0x34, 0xd4, 0x9d, 0x94, 0x74, 0x3e, 0x99, 0x76, 0x17, 0x33, 0x54,
|
||||
0x2e, 0xf5, 0xbd, 0xce, 0x99, 0xd7, 0x8b, 0xcf, 0x29, 0x26, 0xd5, 0x97, 0xa1, 0xb1, 0xa7, 0xaf,
|
||||
0x6d, 0x4c, 0xaa, 0xdc, 0x8c, 0xd8, 0xd0, 0x17, 0xe3, 0x01, 0x35, 0xa1, 0xd7, 0xff, 0x56, 0x02,
|
||||
0x68, 0x26, 0xfb, 0x21, 0x87, 0xb0, 0x80, 0xf6, 0x88, 0x33, 0xb7, 0x79, 0xa2, 0xdf, 0xf6, 0xb3,
|
||||
0x1b, 0x34, 0x58, 0xf2, 0x41, 0x25, 0x3f, 0x0e, 0x3d, 0xe4, 0x79, 0x56, 0x99, 0x48, 0xcf, 0x4d,
|
||||
0xf6, 0x8b, 0x6b, 0x50, 0x46, 0xef, 0x7b, 0x28, 0xea, 0x2c, 0x20, 0x59, 0xb5, 0x30, 0x9d, 0xb7,
|
||||
0xf6, 0xf3, 0xf9, 0x20, 0xad, 0xf4, 0x0b, 0x8b, 0xb8, 0xa6, 0x52, 0x12, 0x67, 0x4e, 0x2b, 0x34,
|
||||
0x37, 0x26, 0x2b, 0x00, 0x13, 0x5d, 0xa7, 0x6e, 0x91, 0x1f, 0xa0, 0xa8, 0x6b, 0x1d, 0xf9, 0x6c,
|
||||
0xb6, 0x40, 0xac, 0x6f, 0xfe, 0xe7, 0xba, 0xf5, 0x85, 0x45, 0xde, 0x41, 0x41, 0x35, 0x79, 0x92,
|
||||
0xd1, 0xb1, 0x52, 0x13, 0x82, 0xed, 0xcc, 0x83, 0x98, 0x28, 0x7e, 0x02, 0x18, 0x8f, 0x1a, 0x24,
|
||||
0xe3, 0x1f, 0x99, 0xa9, 0x99, 0xc5, 0xae, 0x5f, 0x0f, 0x34, 0x06, 0xde, 0xa9, 0x3e, 0x7b, 0xc2,
|
||||
0x49, 0x66, 0x87, 0x4d, 0xae, 0x91, 0xed, 0xcc, 0x83, 0x18, 0x75, 0xa7, 0x50, 0x9b, 0xf8, 0xc7,
|
||||
0x96, 0xfc, 0x22, 0xdb, 0xc9, 0xab, 0x7f, 0x00, 0xdb, 0x2f, 0x6f, 0x84, 0x35, 0x96, 0x64, 0x7a,
|
||||
0x56, 0x33, 0x9f, 0x49, 0xe3, 0x3a, 0xbf, 0x27, 0xff, 0x7d, 0xb5, 0xd7, 0x6e, 0x8c, 0xd7, 0x56,
|
||||
0xb7, 0x0a, 0xbf, 0xcb, 0xf5, 0x8f, 0x8f, 0x8b, 0xf8, 0x47, 0xf6, 0x57, 0xff, 0x0b, 0x00, 0x00,
|
||||
0xff, 0xff, 0xf1, 0x59, 0xad, 0xb5, 0x66, 0x17, 0x00, 0x00,
|
||||
// 1960 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0x5f, 0x73, 0x1b, 0x49,
|
||||
0x11, 0x67, 0x25, 0x59, 0x7f, 0x5a, 0x96, 0xcf, 0x19, 0x9c, 0x30, 0xd9, 0xe4, 0x12, 0x67, 0x93,
|
||||
0x1c, 0x2a, 0x42, 0xc9, 0x77, 0x3e, 0x72, 0xb9, 0x5c, 0xee, 0xaa, 0xb0, 0x65, 0x0b, 0xfb, 0x2a,
|
||||
0xb1, 0x5d, 0x23, 0x27, 0x29, 0xb8, 0x2a, 0xae, 0x56, 0xd2, 0x58, 0xde, 0xd2, 0x6a, 0x47, 0xec,
|
||||
0x8c, 0x64, 0x8b, 0x27, 0x1e, 0xe0, 0x8d, 0xe2, 0x7b, 0x50, 0x7c, 0x04, 0x9e, 0x78, 0xe3, 0xe3,
|
||||
0xf0, 0x11, 0xa8, 0xf9, 0xb3, 0xab, 0x5d, 0x4b, 0x2b, 0xdb, 0xf0, 0xa4, 0xe9, 0x9e, 0x5f, 0x77,
|
||||
0x4f, 0xf7, 0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|
||||
0xe1, 0x62, 0x63, 0x1a, 0x44, 0x22, 0x30, 0x3a, 0x86, 0x8a, 0xb2, 0xbf, 0x13, 0xf6, 0x39, 0x2e,
|
||||
0x29, 0xc9, 0x2f, 0x6e, 0x70, 0xcc, 0x58, 0x46, 0x1f, 0x71, 0xa6, 0x03, 0xed, 0x43, 0xa5, 0xe9,
|
||||
0x76, 0xcf, 0x69, 0x2b, 0x64, 0x43, 0x5c, 0x56, 0x0a, 0x7f, 0xbe, 0x58, 0xa1, 0x82, 0x19, 0x85,
|
||||
0x46, 0x4d, 0x2c, 0x89, 0x76, 0xa0, 0xa4, 0x88, 0x53, 0x86, 0x2b, 0xb7, 0x53, 0x12, 0xc9, 0x21,
|
||||
0x07, 0x56, 0x9b, 0xfd, 0x90, 0x8d, 0x47, 0x27, 0x6e, 0x48, 0x03, 0x81, 0x41, 0x7d, 0xea, 0x14,
|
||||
0x0f, 0xbd, 0x81, 0xd2, 0xfe, 0xe5, 0x88, 0x85, 0x82, 0xe3, 0xea, 0xb2, 0xcb, 0xab, 0x41, 0xc6,
|
||||
0x80, 0x91, 0x40, 0x8f, 0x00, 0xf6, 0x2f, 0x45, 0xe8, 0x1e, 0x30, 0x19, 0xf6, 0x55, 0xf5, 0x39,
|
||||
0x12, 0x1c, 0xd4, 0x82, 0xe2, 0x5b, 0xb7, 0x43, 0x7d, 0x8e, 0x6b, 0x4a, 0x77, 0xe3, 0x06, 0x81,
|
||||
0xd5, 0x02, 0xda, 0x90, 0x91, 0x96, 0x79, 0x7d, 0x44, 0xc5, 0x05, 0x0b, 0x07, 0xef, 0x58, 0x8f,
|
||||
0xe2, 0x35, 0x9d, 0xd7, 0x09, 0x16, 0x7a, 0x06, 0xb5, 0x23, 0xa6, 0x83, 0xe7, 0xf9, 0x82, 0x86,
|
||||
0xf8, 0x13, 0x75, 0x98, 0x34, 0x53, 0xdd, 0x65, 0xdf, 0x15, 0x67, 0x2c, 0x1c, 0x72, 0xbc, 0xae,
|
||||
0x10, 0x33, 0x86, 0xcc, 0xa0, 0x36, 0xed, 0x86, 0x54, 0x70, 0x7c, 0x67, 0x59, 0x06, 0x69, 0x10,
|
||||
0x89, 0xc0, 0x08, 0x43, 0xa9, 0x7d, 0x3e, 0x6c, 0x7b, 0x7f, 0xa4, 0x18, 0x6d, 0x5a, 0xf5, 0x3c,
|
||||
0x89, 0x48, 0xf4, 0x02, 0xf2, 0xed, 0xf6, 0x01, 0xfe, 0xa9, 0xd2, 0x76, 0x3f, 0x43, 0x5b, 0xfb,
|
||||
0x80, 0x48, 0x14, 0x42, 0x50, 0x38, 0x75, 0xfb, 0x1c, 0x6f, 0xa8, 0x73, 0xa9, 0x35, 0xba, 0x07,
|
||||
0xc5, 0x53, 0x37, 0xec, 0x53, 0x81, 0xef, 0x2a, 0x9f, 0x0d, 0x85, 0x5e, 0x43, 0xe9, 0xbd, 0xef,
|
||||
0x0d, 0x3d, 0xc1, 0xf1, 0xbd, 0x65, 0x97, 0x53, 0x83, 0x8e, 0x47, 0x82, 0x44, 0x78, 0x79, 0x5a,
|
||||
0x15, 0x6f, 0x1a, 0xe2, 0x9f, 0x29, 0x9d, 0x11, 0x29, 0x77, 0x4c, 0xb8, 0x30, 0xde, 0xb4, 0xea,
|
||||
0x65, 0x12, 0x91, 0xf2, 0x68, 0x27, 0x63, 0xdf, 0xc7, 0xf7, 0x15, 0x5b, 0xad, 0xf5, 0xb7, 0x97,
|
||||
0x69, 0x70, 0x32, 0xe6, 0xe7, 0xd8, 0x56, 0x3b, 0x09, 0xce, 0x6c, 0xff, 0x2d, 0x73, 0x7b, 0xf8,
|
||||
0x41, 0x72, 0x5f, 0x72, 0xd0, 0x21, 0xac, 0xb6, 0x55, 0x5b, 0x3a, 0x51, 0xcd, 0x08, 0x3f, 0x54,
|
||||
0x7e, 0x3c, 0x6f, 0xc8, 0xce, 0xd5, 0x88, 0x3a, 0x97, 0xf4, 0x21, 0xd9, 0xbc, 0x1a, 0x1a, 0x4c,
|
||||
0x52, 0xa2, 0x51, 0x5d, 0xfd, 0x74, 0x56, 0x57, 0x6d, 0x28, 0xff, 0x46, 0x26, 0xb9, 0x64, 0x3f,
|
||||
0x52, 0xec, 0x98, 0x96, 0xc9, 0xb4, 0x13, 0x04, 0x4c, 0xb8, 0xba, 0xee, 0x3e, 0x56, 0xe1, 0x4e,
|
||||
0xb2, 0xd0, 0x57, 0x70, 0xef, 0xa3, 0x27, 0xce, 0x4f, 0x42, 0x36, 0xa1, 0x81, 0x1b, 0x74, 0x69,
|
||||
0x54, 0xd1, 0xf1, 0xa6, 0x72, 0x23, 0x63, 0xd7, 0xfe, 0x35, 0xa0, 0xf9, 0xea, 0x25, 0x4f, 0x37,
|
||||
0xa0, 0xd3, 0xa8, 0xea, 0x0f, 0xe8, 0x54, 0x16, 0xb0, 0x89, 0xeb, 0x8f, 0xa3, 0xda, 0xab, 0x89,
|
||||
0x6f, 0x72, 0x5f, 0x5b, 0xf6, 0xb7, 0xb0, 0x96, 0x2e, 0x2c, 0xb7, 0x92, 0x7e, 0x0d, 0xd5, 0xc4,
|
||||
0xed, 0xb9, 0x8d, 0xa8, 0xf3, 0x2f, 0x0b, 0xaa, 0x89, 0x2b, 0xae, 0x92, 0x71, 0x3a, 0xa2, 0x46,
|
||||
0x58, 0xad, 0xd1, 0x2e, 0xac, 0xec, 0x08, 0x11, 0xca, 0x56, 0x25, 0xf3, 0xf9, 0x97, 0xd7, 0x16,
|
||||
0x8a, 0x86, 0x82, 0xeb, 0xab, 0xac, 0x45, 0x65, 0xf0, 0xf7, 0x28, 0x17, 0x5e, 0xa0, 0x42, 0xad,
|
||||
0x3a, 0x4b, 0x85, 0x24, 0x59, 0xf6, 0xd7, 0x00, 0x33, 0xb1, 0x5b, 0xf9, 0xf0, 0x0f, 0x0b, 0xee,
|
||||
0xcc, 0x55, 0xc3, 0x85, 0x9e, 0x1c, 0xa4, 0x3d, 0xd9, 0xbe, 0x61, 0x65, 0x9d, 0xf7, 0xe7, 0xff,
|
||||
0x38, 0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|
||||
0x45, 0xdd, 0xed, 0xe3, 0x96, 0x02, 0x94, 0x89, 0x5c, 0x4a, 0x5f, 0xe3, 0x83, 0xac, 0x6a, 0x1b,
|
||||
0xce, 0x27, 0x50, 0x53, 0xaa, 0xe3, 0x08, 0xfe, 0x29, 0x07, 0xa5, 0x48, 0xc5, 0xab, 0x94, 0xdf,
|
||||
0x4f, 0xb2, 0xfc, 0x9e, 0x77, 0xf9, 0x25, 0x14, 0x64, 0x8d, 0x31, 0x2e, 0x67, 0x8c, 0x32, 0xad,
|
||||
0x5e, 0x42, 0x4c, 0xc2, 0xd1, 0x77, 0x50, 0x24, 0x94, 0xcb, 0xb1, 0x4b, 0x3f, 0x50, 0x9e, 0x2e,
|
||||
0x16, 0xd4, 0x98, 0x99, 0xb0, 0x11, 0x92, 0xe2, 0x6d, 0xaf, 0x1f, 0xb8, 0x3e, 0x2e, 0x2c, 0x13,
|
||||
0xd7, 0x98, 0x84, 0xb8, 0x66, 0xcc, 0xc2, 0xfd, 0x17, 0x0b, 0xaa, 0x4b, 0x43, 0xbd, 0xfc, 0x09,
|
||||
0x39, 0xf7, 0xac, 0xcd, 0xff, 0x8f, 0xcf, 0xda, 0x3f, 0xe7, 0xd2, 0x8a, 0xd4, 0x04, 0x26, 0xef,
|
||||
0xd3, 0x88, 0x79, 0x81, 0x30, 0x29, 0x9b, 0xe0, 0xc8, 0x83, 0x36, 0x87, 0x3d, 0xd3, 0x18, 0xe4,
|
||||
0x52, 0x5e, 0xb3, 0x23, 0x26, 0x79, 0x55, 0x95, 0x06, 0x9a, 0x98, 0x95, 0xfd, 0xbc, 0x29, 0xfb,
|
||||
0x32, 0x35, 0xde, 0x73, 0x1a, 0xaa, 0xc0, 0x55, 0x88, 0x5a, 0xcb, 0x4a, 0x7f, 0xc4, 0x14, 0x77,
|
||||
0x45, 0x09, 0x1b, 0x4a, 0x59, 0xb9, 0xe8, 0xe1, 0xa2, 0x0e, 0x47, 0xf3, 0x22, 0xb2, 0x72, 0xd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, 0xe4, 0x51, 0x46, 0xc7,
|
||||
0x4a, 0x4c, 0x08, 0xb6, 0xb3, 0x0c, 0x62, 0xa2, 0xf8, 0x23, 0xc0, 0x6c, 0xd4, 0x40, 0x19, 0xff,
|
||||
0xda, 0xcc, 0xcd, 0x2c, 0x76, 0xfd, 0x7a, 0xa0, 0x31, 0xf0, 0x4e, 0xf6, 0xd9, 0x33, 0x86, 0x32,
|
||||
0x3b, 0x6c, 0x7c, 0x8d, 0x6c, 0x67, 0x19, 0xc4, 0xa8, 0x3b, 0x87, 0x5a, 0xea, 0x5f, 0x5d, 0xf4,
|
||||
0x8b, 0x6c, 0x27, 0xaf, 0xfe, 0x49, 0x6c, 0xbf, 0xb8, 0x11, 0xd6, 0x58, 0x12, 0xc9, 0x59, 0xcd,
|
||||
0x6c, 0xa3, 0xc6, 0x75, 0x7e, 0xa7, 0xff, 0xa1, 0xb5, 0xb7, 0x6e, 0x8c, 0xd7, 0x56, 0x77, 0x0b,
|
||||
0xbf, 0xcb, 0x8d, 0x3a, 0x9d, 0xa2, 0xfa, 0xb3, 0xfb, 0xcb, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff,
|
||||
0xc1, 0x07, 0x8b, 0x2b, 0x8a, 0x17, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
@@ -112,8 +112,9 @@ message Secret {
|
||||
}
|
||||
|
||||
message PrintFunc {
|
||||
string Name = 1;
|
||||
string Format = 2;
|
||||
string Name = 1;
|
||||
string Format = 2;
|
||||
bool IgnoreStatus = 3;
|
||||
}
|
||||
|
||||
message InspectRequest {
|
||||
|
@@ -4,7 +4,6 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/builder/remotecontext/urlutil"
|
||||
"github.com/moby/buildkit/util/gitutil"
|
||||
)
|
||||
|
||||
@@ -22,7 +21,7 @@ func ResolveOptionPaths(options *BuildOptions) (_ *BuildOptions, err error) {
|
||||
}
|
||||
}
|
||||
if options.DockerfileName != "" && options.DockerfileName != "-" {
|
||||
if localContext && !urlutil.IsURL(options.DockerfileName) {
|
||||
if localContext && !isHTTPURL(options.DockerfileName) {
|
||||
options.DockerfileName, err = filepath.Abs(options.DockerfileName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -164,8 +163,15 @@ func ResolveOptionPaths(options *BuildOptions) (_ *BuildOptions, err error) {
|
||||
return options, nil
|
||||
}
|
||||
|
||||
// isHTTPURL returns true if the provided str is an HTTP(S) URL by checking if it
|
||||
// has a http:// or https:// scheme. No validation is performed to verify if the
|
||||
// URL is well-formed.
|
||||
func isHTTPURL(str string) bool {
|
||||
return strings.HasPrefix(str, "https://") || strings.HasPrefix(str, "http://")
|
||||
}
|
||||
|
||||
func isRemoteURL(c string) bool {
|
||||
if urlutil.IsURL(c) {
|
||||
if isHTTPURL(c) {
|
||||
return true
|
||||
}
|
||||
if _, err := gitutil.ParseGitRef(c); err == nil {
|
||||
|
@@ -210,7 +210,7 @@ func (c *Client) build(ctx context.Context, ref string, options pb.BuildOptions,
|
||||
}
|
||||
return err
|
||||
} else if n > 0 {
|
||||
if stream.Send(&pb.InputMessage{
|
||||
if err := stream.Send(&pb.InputMessage{
|
||||
Input: &pb.InputMessage_Data{
|
||||
Data: &pb.DataMessage{
|
||||
Data: buf[:n],
|
||||
|
@@ -358,7 +358,7 @@ func copyToStream(fd uint32, snd msgStream, r io.Reader) error {
|
||||
}
|
||||
return err
|
||||
} else if n > 0 {
|
||||
if snd.Send(&pb.Message{
|
||||
if err := snd.Send(&pb.Message{
|
||||
Input: &pb.Message_File{
|
||||
File: &pb.FdMessage{
|
||||
Fd: fd,
|
||||
|
@@ -8,7 +8,7 @@ variable "DESTDIR" {
|
||||
default = "./bin"
|
||||
}
|
||||
variable "GOLANGCI_LINT_MULTIPLATFORM" {
|
||||
default = null
|
||||
default = ""
|
||||
}
|
||||
|
||||
# Special target: https://github.com/docker/metadata-action#bake-definition
|
||||
@@ -28,14 +28,14 @@ group "default" {
|
||||
}
|
||||
|
||||
group "validate" {
|
||||
targets = ["lint", "validate-vendor", "validate-docs"]
|
||||
targets = ["lint", "lint-gopls", "validate-vendor", "validate-docs"]
|
||||
}
|
||||
|
||||
target "lint" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "./hack/dockerfiles/lint.Dockerfile"
|
||||
output = ["type=cacheonly"]
|
||||
platforms = GOLANGCI_LINT_MULTIPLATFORM != null ? [
|
||||
platforms = GOLANGCI_LINT_MULTIPLATFORM != "" ? [
|
||||
"darwin/amd64",
|
||||
"darwin/arm64",
|
||||
"linux/amd64",
|
||||
@@ -48,6 +48,11 @@ target "lint" {
|
||||
] : []
|
||||
}
|
||||
|
||||
target "lint-gopls" {
|
||||
inherits = ["lint"]
|
||||
target = "gopls-analyze"
|
||||
}
|
||||
|
||||
target "validate-vendor" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "./hack/dockerfiles/vendor.Dockerfile"
|
||||
|
@@ -1,4 +1,6 @@
|
||||
# Bake file reference
|
||||
---
|
||||
title: Bake file reference
|
||||
---
|
||||
|
||||
The Bake file is a file for defining workflows that you run using `docker buildx bake`.
|
||||
|
||||
|
@@ -1,3 +0,0 @@
|
||||
# CI/CD
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/ci/)
|
@@ -1,3 +0,0 @@
|
||||
# CNI networking
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/buildkit/configure/#cni-networking)
|
@@ -1,3 +0,0 @@
|
||||
# Color output controls
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/env-vars/#buildkit_colors)
|
@@ -1,3 +0,0 @@
|
||||
# Using a custom network
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/drivers/docker-container/#custom-network)
|
@@ -1,3 +0,0 @@
|
||||
# Using a custom registry configuration
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/buildkit/configure/#setting-registry-certificates)
|
@@ -1,3 +0,0 @@
|
||||
# OpenTelemetry support
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/opentelemetry/)
|
@@ -1,3 +0,0 @@
|
||||
# Registry mirror
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/buildkit/configure/#registry-mirror)
|
@@ -1,3 +0,0 @@
|
||||
# Resource limiting
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/buildkit/configure/#resource-limiting)
|
@@ -1,3 +0,0 @@
|
||||
# Defining additional build contexts and linking targets
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/bake/build-contexts)
|
@@ -1,3 +0,0 @@
|
||||
# Building from Compose file
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/bake/compose-file)
|
@@ -1,3 +0,0 @@
|
||||
# Configuring builds
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/bake/configuring-build)
|
@@ -1,3 +0,0 @@
|
||||
# Bake file definition
|
||||
|
||||
This page has moved to [docs/bake-reference.md](../../bake-reference.md)
|
@@ -1,3 +0,0 @@
|
||||
# User defined HCL functions
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/bake/hcl-funcs)
|
@@ -1,3 +0,0 @@
|
||||
# High-level build options with Bake
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/bake)
|
3
docs/manuals/cache/backends/azblob.md
vendored
3
docs/manuals/cache/backends/azblob.md
vendored
@@ -1,3 +0,0 @@
|
||||
# Azure Blob Storage cache storage
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/cache/backends/azblob)
|
3
docs/manuals/cache/backends/gha.md
vendored
3
docs/manuals/cache/backends/gha.md
vendored
@@ -1,3 +0,0 @@
|
||||
# GitHub Actions cache storage
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/cache/backends/gha)
|
3
docs/manuals/cache/backends/index.md
vendored
3
docs/manuals/cache/backends/index.md
vendored
@@ -1,3 +0,0 @@
|
||||
# Cache storage backends
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/cache/backends)
|
3
docs/manuals/cache/backends/inline.md
vendored
3
docs/manuals/cache/backends/inline.md
vendored
@@ -1,3 +0,0 @@
|
||||
# Inline cache storage
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/cache/backends/inline)
|
3
docs/manuals/cache/backends/local.md
vendored
3
docs/manuals/cache/backends/local.md
vendored
@@ -1,3 +0,0 @@
|
||||
# Local cache storage
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/cache/backends/local)
|
3
docs/manuals/cache/backends/registry.md
vendored
3
docs/manuals/cache/backends/registry.md
vendored
@@ -1,3 +0,0 @@
|
||||
# Registry cache storage
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/cache/backends/registry)
|
3
docs/manuals/cache/backends/s3.md
vendored
3
docs/manuals/cache/backends/s3.md
vendored
@@ -1,3 +0,0 @@
|
||||
# Amazon S3 cache storage
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/cache/backends/s3)
|
@@ -1,3 +0,0 @@
|
||||
# Docker container driver
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/drivers/docker-container)
|
@@ -1,3 +0,0 @@
|
||||
# Docker driver
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/drivers/docker)
|
@@ -1,3 +0,0 @@
|
||||
# Buildx drivers overview
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/drivers)
|
@@ -1,3 +0,0 @@
|
||||
# Kubernetes driver
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/drivers/kubernetes)
|
@@ -1,3 +0,0 @@
|
||||
# Remote driver
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/drivers/remote)
|
@@ -1,3 +0,0 @@
|
||||
# Image and registry exporters
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/exporters/image-registry)
|
@@ -1,3 +0,0 @@
|
||||
# Exporters overview
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/exporters)
|
@@ -1,3 +0,0 @@
|
||||
# Local and tar exporters
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/exporters/local-tar)
|
@@ -1,3 +0,0 @@
|
||||
# OCI and Docker exporters
|
||||
|
||||
This page has moved to [Docker Docs website](https://docs.docker.com/build/building/exporters/oci-docker)
|
@@ -13,20 +13,20 @@ Build from a file
|
||||
|
||||
### Options
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
|:------------------------------------|:--------------|:--------|:-----------------------------------------------------------------------------------------|
|
||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||
| [`-f`](#file), [`--file`](#file) | `stringArray` | | Build definition file |
|
||||
| `--load` | | | Shorthand for `--set=*.output=type=docker` |
|
||||
| [`--metadata-file`](#metadata-file) | `string` | | Write build result metadata to a file |
|
||||
| [`--no-cache`](#no-cache) | | | Do not use cache when building the image |
|
||||
| [`--print`](#print) | | | Print the options without building |
|
||||
| [`--progress`](#progress) | `string` | `auto` | Set type of progress output (`auto`, `plain`, `tty`). Use plain to show container output |
|
||||
| [`--provenance`](#provenance) | `string` | | Shorthand for `--set=*.attest=type=provenance` |
|
||||
| [`--pull`](#pull) | | | Always attempt to pull all referenced images |
|
||||
| `--push` | | | Shorthand for `--set=*.output=type=registry` |
|
||||
| [`--sbom`](#sbom) | `string` | | Shorthand for `--set=*.attest=type=sbom` |
|
||||
| [`--set`](#set) | `stringArray` | | Override target value (e.g., `targetpattern.key=value`) |
|
||||
| Name | Type | Default | Description |
|
||||
|:------------------------------------|:--------------|:--------|:----------------------------------------------------------------------------------------------------|
|
||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||
| [`-f`](#file), [`--file`](#file) | `stringArray` | | Build definition file |
|
||||
| `--load` | | | Shorthand for `--set=*.output=type=docker` |
|
||||
| [`--metadata-file`](#metadata-file) | `string` | | Write build result metadata to a file |
|
||||
| [`--no-cache`](#no-cache) | | | Do not use cache when building the image |
|
||||
| [`--print`](#print) | | | Print the options without building |
|
||||
| [`--progress`](#progress) | `string` | `auto` | Set type of progress output (`auto`, `plain`, `tty`, `rawjson`). Use plain to show container output |
|
||||
| [`--provenance`](#provenance) | `string` | | Shorthand for `--set=*.attest=type=provenance` |
|
||||
| [`--pull`](#pull) | | | Always attempt to pull all referenced images |
|
||||
| `--push` | | | Shorthand for `--set=*.output=type=registry` |
|
||||
| [`--sbom`](#sbom) | `string` | | Shorthand for `--set=*.attest=type=sbom` |
|
||||
| [`--set`](#set) | `stringArray` | | Override target value (e.g., `targetpattern.key=value`) |
|
||||
|
||||
|
||||
<!---MARKER_GEN_END-->
|
||||
|
@@ -24,7 +24,9 @@ Start a build
|
||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||
| [`--cache-from`](#cache-from) | `stringArray` | | External cache sources (e.g., `user/app:cache`, `type=local,src=path/to/dir`) |
|
||||
| [`--cache-to`](#cache-to) | `stringArray` | | Cache export destinations (e.g., `user/app:cache`, `type=local,dest=path/to/dir`) |
|
||||
| `--call` | `string` | `build` | Set method for evaluating build (`check`, `outline`, `targets`) |
|
||||
| [`--cgroup-parent`](https://docs.docker.com/reference/cli/docker/image/build/#cgroup-parent) | `string` | | Set the parent cgroup for the `RUN` instructions during build |
|
||||
| `--check` | | | Shorthand for `--call=check` |
|
||||
| `--detach` | | | Detach buildx server (supported only on linux) (EXPERIMENTAL) |
|
||||
| [`-f`](https://docs.docker.com/reference/cli/docker/image/build/#file), [`--file`](https://docs.docker.com/reference/cli/docker/image/build/#file) | `string` | | Name of the Dockerfile (default: `PATH/Dockerfile`) |
|
||||
| `--iidfile` | `string` | | Write the image ID to a file |
|
||||
@@ -36,8 +38,7 @@ Start a build
|
||||
| [`--no-cache-filter`](#no-cache-filter) | `stringArray` | | Do not cache specified stages |
|
||||
| [`-o`](#output), [`--output`](#output) | `stringArray` | | Output destination (format: `type=local,dest=path`) |
|
||||
| [`--platform`](#platform) | `stringArray` | | Set target platform for build |
|
||||
| `--print` | `string` | | Print result of information request (e.g., outline, targets) (EXPERIMENTAL) |
|
||||
| [`--progress`](#progress) | `string` | `auto` | Set type of progress output (`auto`, `plain`, `tty`). Use plain to show container output |
|
||||
| [`--progress`](#progress) | `string` | `auto` | Set type of progress output (`auto`, `plain`, `tty`, `rawjson`). Use plain to show container output |
|
||||
| [`--provenance`](#provenance) | `string` | | Shorthand for `--attest=type=provenance` |
|
||||
| `--pull` | | | Always attempt to pull all referenced images |
|
||||
| [`--push`](#push) | | | Shorthand for `--output=type=registry` |
|
||||
@@ -550,8 +551,8 @@ $ docker buildx build --platform=darwin .
|
||||
--progress=VALUE
|
||||
```
|
||||
|
||||
Set type of progress output (`auto`, `plain`, `tty`). Use plain to show container
|
||||
output (default "auto").
|
||||
Set type of progress output (`auto`, `plain`, `tty`, `rawjson`). Use `plain` to show container
|
||||
output (default `auto`).
|
||||
|
||||
> **Note**
|
||||
>
|
||||
@@ -574,8 +575,11 @@ $ docker buildx build --load --progress=plain .
|
||||
|
||||
> **Note**
|
||||
>
|
||||
> Check also our [Color output controls guide](https://github.com/docker/buildx/blob/master/docs/guides/color-output.md)
|
||||
> for modifying the colors that are used to output information to the terminal.
|
||||
> Check also the [`BUILDKIT_COLORS`](https://docs.docker.com/build/building/variables/#buildkit_colors)
|
||||
> environment variable for modifying the colors of the terminal output.
|
||||
|
||||
The `rawjson` output marshals the solve status events from BuildKit to JSON lines.
|
||||
This mode is designed to be read by an external program.
|
||||
|
||||
### <a name="provenance"></a> Create provenance attestations (--provenance)
|
||||
|
||||
|
@@ -12,15 +12,15 @@ Start debugger (EXPERIMENTAL)
|
||||
|
||||
### Options
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
|:------------------|:---------|:--------|:---------------------------------------------------------------------------------------------------------|
|
||||
| `--builder` | `string` | | Override the configured builder instance |
|
||||
| `--detach` | `bool` | `true` | Detach buildx server for the monitor (supported only on linux) (EXPERIMENTAL) |
|
||||
| `--invoke` | `string` | | Launch a monitor with executing specified command (EXPERIMENTAL) |
|
||||
| `--on` | `string` | `error` | When to launch the monitor ([always, error]) (EXPERIMENTAL) |
|
||||
| `--progress` | `string` | `auto` | Set type of progress output (`auto`, `plain`, `tty`) for the monitor. Use plain to show container output |
|
||||
| `--root` | `string` | | Specify root directory of server to connect for the monitor (EXPERIMENTAL) |
|
||||
| `--server-config` | `string` | | Specify buildx server config file for the monitor (used only when launching new server) (EXPERIMENTAL) |
|
||||
| Name | Type | Default | Description |
|
||||
|:------------------|:---------|:--------|:--------------------------------------------------------------------------------------------------------------------|
|
||||
| `--builder` | `string` | | Override the configured builder instance |
|
||||
| `--detach` | `bool` | `true` | Detach buildx server for the monitor (supported only on linux) (EXPERIMENTAL) |
|
||||
| `--invoke` | `string` | | Launch a monitor with executing specified command (EXPERIMENTAL) |
|
||||
| `--on` | `string` | `error` | When to launch the monitor ([always, error]) (EXPERIMENTAL) |
|
||||
| `--progress` | `string` | `auto` | Set type of progress output (`auto`, `plain`, `tty`, `rawjson`) for the monitor. Use plain to show container output |
|
||||
| `--root` | `string` | | Specify root directory of server to connect for the monitor (EXPERIMENTAL) |
|
||||
| `--server-config` | `string` | | Specify buildx server config file for the monitor (used only when launching new server) (EXPERIMENTAL) |
|
||||
|
||||
|
||||
<!---MARKER_GEN_END-->
|
||||
|
@@ -20,7 +20,9 @@ Start a build
|
||||
| `--builder` | `string` | | Override the configured builder instance |
|
||||
| `--cache-from` | `stringArray` | | External cache sources (e.g., `user/app:cache`, `type=local,src=path/to/dir`) |
|
||||
| `--cache-to` | `stringArray` | | Cache export destinations (e.g., `user/app:cache`, `type=local,dest=path/to/dir`) |
|
||||
| `--call` | `string` | `build` | Set method for evaluating build (`check`, `outline`, `targets`) |
|
||||
| [`--cgroup-parent`](https://docs.docker.com/reference/cli/docker/image/build/#cgroup-parent) | `string` | | Set the parent cgroup for the `RUN` instructions during build |
|
||||
| `--check` | | | Shorthand for `--call=check` |
|
||||
| `--detach` | | | Detach buildx server (supported only on linux) (EXPERIMENTAL) |
|
||||
| [`-f`](https://docs.docker.com/reference/cli/docker/image/build/#file), [`--file`](https://docs.docker.com/reference/cli/docker/image/build/#file) | `string` | | Name of the Dockerfile (default: `PATH/Dockerfile`) |
|
||||
| `--iidfile` | `string` | | Write the image ID to a file |
|
||||
@@ -32,8 +34,7 @@ Start a build
|
||||
| `--no-cache-filter` | `stringArray` | | Do not cache specified stages |
|
||||
| `-o`, `--output` | `stringArray` | | Output destination (format: `type=local,dest=path`) |
|
||||
| `--platform` | `stringArray` | | Set target platform for build |
|
||||
| `--print` | `string` | | Print result of information request (e.g., outline, targets) (EXPERIMENTAL) |
|
||||
| `--progress` | `string` | `auto` | Set type of progress output (`auto`, `plain`, `tty`). Use plain to show container output |
|
||||
| `--progress` | `string` | `auto` | Set type of progress output (`auto`, `plain`, `tty`, `rawjson`). Use plain to show container output |
|
||||
| `--provenance` | `string` | | Shorthand for `--attest=type=provenance` |
|
||||
| `--pull` | | | Always attempt to pull all referenced images |
|
||||
| `--push` | | | Shorthand for `--output=type=registry` |
|
||||
|
@@ -5,11 +5,11 @@ Proxy current stdio streams to builder instance
|
||||
|
||||
### Options
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
|:-------------|:---------|:--------|:-------------------------------------------------|
|
||||
| `--builder` | `string` | | Override the configured builder instance |
|
||||
| `--platform` | `string` | | Target platform: this is used for node selection |
|
||||
| `--progress` | `string` | `quiet` | Set type of progress output (auto, plain, tty). |
|
||||
| Name | Type | Default | Description |
|
||||
|:-------------|:---------|:--------|:----------------------------------------------------------------------------------------------------|
|
||||
| `--builder` | `string` | | Override the configured builder instance |
|
||||
| `--platform` | `string` | | Target platform: this is used for node selection |
|
||||
| `--progress` | `string` | `quiet` | Set type of progress output (`auto`, `plain`, `tty`, `rawjson`). Use plain to show container output |
|
||||
|
||||
|
||||
<!---MARKER_GEN_END-->
|
||||
|
@@ -9,15 +9,16 @@ Create a new image based on source images
|
||||
|
||||
### Options
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
|:---------------------------------|:--------------|:--------|:-----------------------------------------------------------------------------------------|
|
||||
| [`--annotation`](#annotation) | `stringArray` | | Add annotation to the image |
|
||||
| [`--append`](#append) | | | Append to existing manifest |
|
||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||
| [`--dry-run`](#dry-run) | | | Show final image instead of pushing |
|
||||
| [`-f`](#file), [`--file`](#file) | `stringArray` | | Read source descriptor from file |
|
||||
| `--progress` | `string` | `auto` | Set type of progress output (`auto`, `plain`, `tty`). Use plain to show container output |
|
||||
| [`-t`](#tag), [`--tag`](#tag) | `stringArray` | | Set reference for new image |
|
||||
| Name | Type | Default | Description |
|
||||
|:---------------------------------|:--------------|:--------|:------------------------------------------------------------------------------------------------------------------------------|
|
||||
| [`--annotation`](#annotation) | `stringArray` | | Add annotation to the image |
|
||||
| [`--append`](#append) | | | Append to existing manifest |
|
||||
| [`--builder`](#builder) | `string` | | Override the configured builder instance |
|
||||
| [`--dry-run`](#dry-run) | | | Show final image instead of pushing |
|
||||
| [`-f`](#file), [`--file`](#file) | `stringArray` | | Read source descriptor from file |
|
||||
| `--prefer-index` | `bool` | `true` | When only a single source is specified, prefer outputting an image index or manifest list instead of performing a carbon copy |
|
||||
| `--progress` | `string` | `auto` | Set type of progress output (`auto`, `plain`, `tty`, `rawjson`). Use plain to show container output |
|
||||
| [`-t`](#tag), [`--tag`](#tag) | `stringArray` | | Set reference for new image |
|
||||
|
||||
|
||||
<!---MARKER_GEN_END-->
|
||||
@@ -26,8 +27,13 @@ Create a new image based on source images
|
||||
|
||||
Create a new manifest list based on source manifests. The source manifests can
|
||||
be manifest lists or single platform distribution manifests and must already
|
||||
exist in the registry where the new manifest is created. If only one source is
|
||||
specified, create performs a carbon copy.
|
||||
exist in the registry where the new manifest is created.
|
||||
|
||||
If only one source is specified and that source is a manifest list or image index,
|
||||
create performs a carbon copy. If one source is specified and that source is *not*
|
||||
a list or index, the output will be a manifest list, however you can disable this
|
||||
behavior with `--prefer-index=false` which attempts to preserve the source manifest
|
||||
format in the output.
|
||||
|
||||
## Examples
|
||||
|
||||
|
@@ -77,7 +77,7 @@ func (d *Driver) Bootstrap(ctx context.Context, l progress.Logger) error {
|
||||
return err
|
||||
}
|
||||
return sub.Wrap("starting container "+d.Name, func() error {
|
||||
if err := d.start(ctx, sub); err != nil {
|
||||
if err := d.start(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
return d.wait(ctx, sub)
|
||||
@@ -188,7 +188,7 @@ func (d *Driver) create(ctx context.Context, l progress.SubLogger) error {
|
||||
if err := d.copyToContainer(ctx, d.InitConfig.Files); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := d.start(ctx, l); err != nil {
|
||||
if err := d.start(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -203,14 +203,12 @@ func (d *Driver) wait(ctx context.Context, l progress.SubLogger) error {
|
||||
bufStderr := &bytes.Buffer{}
|
||||
if err := d.run(ctx, []string{"buildctl", "debug", "workers"}, bufStdout, bufStderr); err != nil {
|
||||
if try > 15 {
|
||||
if err != nil {
|
||||
d.copyLogs(context.TODO(), l)
|
||||
if bufStdout.Len() != 0 {
|
||||
l.Log(1, bufStdout.Bytes())
|
||||
}
|
||||
if bufStderr.Len() != 0 {
|
||||
l.Log(2, bufStderr.Bytes())
|
||||
}
|
||||
d.copyLogs(context.TODO(), l)
|
||||
if bufStdout.Len() != 0 {
|
||||
l.Log(1, bufStdout.Bytes())
|
||||
}
|
||||
if bufStderr.Len() != 0 {
|
||||
l.Log(2, bufStderr.Bytes())
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -304,7 +302,7 @@ func (d *Driver) run(ctx context.Context, cmd []string, stdout, stderr io.Writer
|
||||
return nil
|
||||
}
|
||||
|
||||
func (d *Driver) start(ctx context.Context, l progress.SubLogger) error {
|
||||
func (d *Driver) start(ctx context.Context) error {
|
||||
return d.DockerAPI.ContainerStart(ctx, d.Name, container.StartOptions{})
|
||||
}
|
||||
|
||||
|
@@ -83,6 +83,11 @@ func ParseBuilderName(name string) (string, error) {
|
||||
|
||||
func Boot(ctx, clientContext context.Context, d *DriverHandle, pw progress.Writer) (*client.Client, error) {
|
||||
try := 0
|
||||
logger := discardLogger
|
||||
if pw != nil {
|
||||
logger = pw.Write
|
||||
}
|
||||
|
||||
for {
|
||||
info, err := d.Info(ctx)
|
||||
if err != nil {
|
||||
@@ -93,7 +98,7 @@ func Boot(ctx, clientContext context.Context, d *DriverHandle, pw progress.Write
|
||||
if try > 2 {
|
||||
return nil, errors.Errorf("failed to bootstrap %T driver in attempts", d)
|
||||
}
|
||||
if err := d.Bootstrap(ctx, pw.Write); err != nil {
|
||||
if err := d.Bootstrap(ctx, logger); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
@@ -109,6 +114,8 @@ func Boot(ctx, clientContext context.Context, d *DriverHandle, pw progress.Write
|
||||
}
|
||||
}
|
||||
|
||||
func discardLogger(*client.SolveStatus) {}
|
||||
|
||||
func historyAPISupported(ctx context.Context, c *client.Client) bool {
|
||||
cl, err := c.ControlClient().ListenBuildHistory(ctx, &controlapi.BuildHistoryRequest{
|
||||
ActiveOnly: true,
|
||||
|
@@ -9,8 +9,8 @@ contexts:
|
||||
cluster: test-cluster
|
||||
user: test-user
|
||||
namespace: zoinx
|
||||
name: test
|
||||
current-context: test
|
||||
name: k3s
|
||||
current-context: k3s
|
||||
kind: Config
|
||||
preferences: {}
|
||||
users:
|
||||
|
@@ -167,11 +167,12 @@ func NewKubernetesConfig(configPath string) clientcmd.ClientConfig {
|
||||
// ConfigFromEndpoint loads kubernetes config from endpoint
|
||||
func ConfigFromEndpoint(endpointName string, s store.Reader) (clientcmd.ClientConfig, error) {
|
||||
if strings.HasPrefix(endpointName, "kubernetes://") {
|
||||
rules := clientcmd.NewDefaultClientConfigLoadingRules()
|
||||
u, _ := url.Parse(endpointName)
|
||||
if kubeconfig := u.Query().Get("kubeconfig"); kubeconfig != "" {
|
||||
_ = os.Setenv(clientcmd.RecommendedConfigPathEnvVar, kubeconfig)
|
||||
rules.Precedence = append(rules.Precedence, kubeconfig)
|
||||
rules.ExplicitPath = kubeconfig
|
||||
}
|
||||
rules := clientcmd.NewDefaultClientConfigLoadingRules()
|
||||
apiConfig, err := rules.Load()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@@ -1,20 +1,35 @@
|
||||
package context
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/cli/cli/command"
|
||||
"github.com/docker/cli/cli/config"
|
||||
"github.com/docker/cli/cli/context/store"
|
||||
cliflags "github.com/docker/cli/cli/flags"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestDefaultContextInitializer(t *testing.T) {
|
||||
os.Setenv("KUBECONFIG", "./fixtures/test-kubeconfig")
|
||||
defer os.Unsetenv("KUBECONFIG")
|
||||
t.Setenv("KUBECONFIG", "./fixtures/test-kubeconfig")
|
||||
ctx, err := command.ResolveDefaultContext(&cliflags.ClientOptions{}, command.DefaultContextStoreConfig())
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "default", ctx.Meta.Name)
|
||||
assert.Equal(t, "zoinx", ctx.Meta.Endpoints[KubernetesEndpoint].(EndpointMeta).DefaultNamespace)
|
||||
}
|
||||
|
||||
func TestConfigFromEndpoint(t *testing.T) {
|
||||
t.Setenv("KUBECONFIG", "./fixtures/test-kubeconfig")
|
||||
cfg, err := ConfigFromEndpoint(
|
||||
"kubernetes:///buildx-test-4c972a3f9d369614b40f28a281790c7e?deployment=buildkit-4c2ed3ed-970f-4f3d-a6df-a4fcbab4d5cf-d9d73&kubeconfig=.%2Ffixtures%2Fk3s-kubeconfig",
|
||||
store.New(config.ContextStoreDir(), command.DefaultContextStoreConfig()),
|
||||
)
|
||||
require.NoError(t, err)
|
||||
rawcfg, err := cfg.RawConfig()
|
||||
require.NoError(t, err)
|
||||
ctxcfg := "k3s"
|
||||
if _, ok := rawcfg.Contexts[ctxcfg]; !ok {
|
||||
t.Errorf("Context config %q not found", ctxcfg)
|
||||
}
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/docker/buildx/store"
|
||||
"github.com/docker/buildx/util/platformutil"
|
||||
"github.com/docker/buildx/util/progress"
|
||||
"github.com/docker/go-units"
|
||||
"github.com/moby/buildkit/client"
|
||||
"github.com/pkg/errors"
|
||||
appsv1 "k8s.io/api/apps/v1"
|
||||
@@ -50,6 +51,7 @@ type Driver struct {
|
||||
configMapClient clientcorev1.ConfigMapInterface
|
||||
podChooser podchooser.PodChooser
|
||||
defaultLoad bool
|
||||
timeout time.Duration
|
||||
}
|
||||
|
||||
func (d *Driver) IsMobyDriver() bool {
|
||||
@@ -88,7 +90,7 @@ func (d *Driver) Bootstrap(ctx context.Context, l progress.Logger) error {
|
||||
}
|
||||
}
|
||||
return sub.Wrap(
|
||||
fmt.Sprintf("waiting for %d pods to be ready", d.minReplicas),
|
||||
fmt.Sprintf("waiting for %d pods to be ready, timeout: %s", d.minReplicas, units.HumanDuration(d.timeout)),
|
||||
func() error {
|
||||
return d.wait(ctx)
|
||||
})
|
||||
@@ -101,22 +103,27 @@ func (d *Driver) wait(ctx context.Context) error {
|
||||
err error
|
||||
depl *appsv1.Deployment
|
||||
)
|
||||
for try := 0; try < 100; try++ {
|
||||
depl, err = d.deploymentClient.Get(ctx, d.deployment.Name, metav1.GetOptions{})
|
||||
if err == nil {
|
||||
if depl.Status.ReadyReplicas >= int32(d.minReplicas) {
|
||||
return nil
|
||||
}
|
||||
err = errors.Errorf("expected %d replicas to be ready, got %d",
|
||||
d.minReplicas, depl.Status.ReadyReplicas)
|
||||
}
|
||||
|
||||
timeoutChan := time.After(d.timeout)
|
||||
ticker := time.NewTicker(100 * time.Millisecond)
|
||||
defer ticker.Stop()
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
case <-time.After(time.Duration(100+try*20) * time.Millisecond):
|
||||
case <-timeoutChan:
|
||||
return err
|
||||
case <-ticker.C:
|
||||
depl, err = d.deploymentClient.Get(ctx, d.deployment.Name, metav1.GetOptions{})
|
||||
if err == nil {
|
||||
if depl.Status.ReadyReplicas >= int32(d.minReplicas) {
|
||||
return nil
|
||||
}
|
||||
err = errors.Errorf("expected %d replicas to be ready, got %d", d.minReplicas, depl.Status.ReadyReplicas)
|
||||
}
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (d *Driver) Info(ctx context.Context) (*driver.Info, error) {
|
||||
|
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
|
||||
@@ -16,8 +17,11 @@ import (
|
||||
"k8s.io/client-go/kubernetes"
|
||||
)
|
||||
|
||||
const prioritySupported = 40
|
||||
const priorityUnsupported = 80
|
||||
const (
|
||||
prioritySupported = 40
|
||||
priorityUnsupported = 80
|
||||
defaultTimeout = 120 * time.Second
|
||||
)
|
||||
|
||||
func init() {
|
||||
driver.Register(&factory{})
|
||||
@@ -68,12 +72,13 @@ func (f *factory) New(ctx context.Context, cfg driver.InitConfig) (driver.Driver
|
||||
clientset: clientset,
|
||||
}
|
||||
|
||||
deploymentOpt, loadbalance, namespace, defaultLoad, err := f.processDriverOpts(deploymentName, namespace, cfg)
|
||||
deploymentOpt, loadbalance, namespace, defaultLoad, timeout, err := f.processDriverOpts(deploymentName, namespace, cfg)
|
||||
if nil != err {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
d.defaultLoad = defaultLoad
|
||||
d.timeout = timeout
|
||||
|
||||
d.deployment, d.configMaps, err = manifest.NewDeployment(deploymentOpt)
|
||||
if err != nil {
|
||||
@@ -102,7 +107,7 @@ func (f *factory) New(ctx context.Context, cfg driver.InitConfig) (driver.Driver
|
||||
return d, nil
|
||||
}
|
||||
|
||||
func (f *factory) processDriverOpts(deploymentName string, namespace string, cfg driver.InitConfig) (*manifest.DeploymentOpt, string, string, bool, error) {
|
||||
func (f *factory) processDriverOpts(deploymentName string, namespace string, cfg driver.InitConfig) (*manifest.DeploymentOpt, string, string, bool, time.Duration, error) {
|
||||
deploymentOpt := &manifest.DeploymentOpt{
|
||||
Name: deploymentName,
|
||||
Image: bkimage.DefaultImage,
|
||||
@@ -114,6 +119,7 @@ func (f *factory) processDriverOpts(deploymentName string, namespace string, cfg
|
||||
}
|
||||
|
||||
defaultLoad := false
|
||||
timeout := defaultTimeout
|
||||
|
||||
deploymentOpt.Qemu.Image = bkimage.QemuImage
|
||||
|
||||
@@ -131,7 +137,7 @@ func (f *factory) processDriverOpts(deploymentName string, namespace string, cfg
|
||||
case "replicas":
|
||||
deploymentOpt.Replicas, err = strconv.Atoi(v)
|
||||
if err != nil {
|
||||
return nil, "", "", false, err
|
||||
return nil, "", "", false, 0, err
|
||||
}
|
||||
case "requests.cpu":
|
||||
deploymentOpt.RequestsCPU = v
|
||||
@@ -148,27 +154,29 @@ func (f *factory) processDriverOpts(deploymentName string, namespace string, cfg
|
||||
case "rootless":
|
||||
deploymentOpt.Rootless, err = strconv.ParseBool(v)
|
||||
if err != nil {
|
||||
return nil, "", "", false, err
|
||||
return nil, "", "", false, 0, err
|
||||
}
|
||||
if _, isImage := cfg.DriverOpts["image"]; !isImage {
|
||||
deploymentOpt.Image = bkimage.DefaultRootlessImage
|
||||
}
|
||||
case "schedulername":
|
||||
deploymentOpt.SchedulerName = v
|
||||
case "serviceaccount":
|
||||
deploymentOpt.ServiceAccountName = v
|
||||
case "nodeselector":
|
||||
deploymentOpt.NodeSelector, err = splitMultiValues(v, ",", "=")
|
||||
if err != nil {
|
||||
return nil, "", "", false, errors.Wrap(err, "cannot parse node selector")
|
||||
return nil, "", "", false, 0, errors.Wrap(err, "cannot parse node selector")
|
||||
}
|
||||
case "annotations":
|
||||
deploymentOpt.CustomAnnotations, err = splitMultiValues(v, ",", "=")
|
||||
if err != nil {
|
||||
return nil, "", "", false, errors.Wrap(err, "cannot parse annotations")
|
||||
return nil, "", "", false, 0, errors.Wrap(err, "cannot parse annotations")
|
||||
}
|
||||
case "labels":
|
||||
deploymentOpt.CustomLabels, err = splitMultiValues(v, ",", "=")
|
||||
if err != nil {
|
||||
return nil, "", "", false, errors.Wrap(err, "cannot parse labels")
|
||||
return nil, "", "", false, 0, errors.Wrap(err, "cannot parse labels")
|
||||
}
|
||||
case "tolerations":
|
||||
ts := strings.Split(v, ";")
|
||||
@@ -193,12 +201,12 @@ func (f *factory) processDriverOpts(deploymentName string, namespace string, cfg
|
||||
case "tolerationSeconds":
|
||||
c, err := strconv.Atoi(kv[1])
|
||||
if nil != err {
|
||||
return nil, "", "", false, err
|
||||
return nil, "", "", false, 0, err
|
||||
}
|
||||
c64 := int64(c)
|
||||
t.TolerationSeconds = &c64
|
||||
default:
|
||||
return nil, "", "", false, errors.Errorf("invalid tolaration %q", v)
|
||||
return nil, "", "", false, 0, errors.Errorf("invalid tolaration %q", v)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -210,13 +218,13 @@ func (f *factory) processDriverOpts(deploymentName string, namespace string, cfg
|
||||
case LoadbalanceSticky:
|
||||
case LoadbalanceRandom:
|
||||
default:
|
||||
return nil, "", "", false, errors.Errorf("invalid loadbalance %q", v)
|
||||
return nil, "", "", false, 0, errors.Errorf("invalid loadbalance %q", v)
|
||||
}
|
||||
loadbalance = v
|
||||
case "qemu.install":
|
||||
deploymentOpt.Qemu.Install, err = strconv.ParseBool(v)
|
||||
if err != nil {
|
||||
return nil, "", "", false, err
|
||||
return nil, "", "", false, 0, err
|
||||
}
|
||||
case "qemu.image":
|
||||
if v != "" {
|
||||
@@ -225,14 +233,19 @@ func (f *factory) processDriverOpts(deploymentName string, namespace string, cfg
|
||||
case "default-load":
|
||||
defaultLoad, err = strconv.ParseBool(v)
|
||||
if err != nil {
|
||||
return nil, "", "", false, err
|
||||
return nil, "", "", false, 0, err
|
||||
}
|
||||
case "timeout":
|
||||
timeout, err = time.ParseDuration(v)
|
||||
if err != nil {
|
||||
return nil, "", "", false, 0, errors.Wrap(err, "cannot parse timeout")
|
||||
}
|
||||
default:
|
||||
return nil, "", "", false, errors.Errorf("invalid driver option %s for driver %s", k, DriverName)
|
||||
return nil, "", "", false, 0, errors.Errorf("invalid driver option %s for driver %s", k, DriverName)
|
||||
}
|
||||
}
|
||||
|
||||
return deploymentOpt, loadbalance, namespace, defaultLoad, nil
|
||||
return deploymentOpt, loadbalance, namespace, defaultLoad, timeout, nil
|
||||
}
|
||||
|
||||
func splitMultiValues(in string, itemsep string, kvsep string) (map[string]string, error) {
|
||||
|
@@ -2,6 +2,7 @@ package kubernetes
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/docker/buildx/driver"
|
||||
"github.com/docker/buildx/driver/bkimage"
|
||||
@@ -40,6 +41,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
"namespace": "test-ns",
|
||||
"image": "test:latest",
|
||||
"replicas": "2",
|
||||
"timeout": "300s",
|
||||
"requests.cpu": "100m",
|
||||
"requests.memory": "32Mi",
|
||||
"limits.cpu": "200m",
|
||||
@@ -54,7 +56,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
"qemu.image": "qemu:latest",
|
||||
"default-load": "true",
|
||||
}
|
||||
r, loadbalance, ns, defaultLoad, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
r, loadbalance, ns, defaultLoad, timeout, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
|
||||
nodeSelectors := map[string]string{
|
||||
"selector1": "value1",
|
||||
@@ -104,6 +106,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
require.True(t, r.Qemu.Install)
|
||||
require.Equal(t, "qemu:latest", r.Qemu.Image)
|
||||
require.True(t, defaultLoad)
|
||||
require.Equal(t, 300*time.Second, timeout)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -111,7 +114,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
"NoOptions", func(t *testing.T) {
|
||||
cfg.DriverOpts = map[string]string{}
|
||||
|
||||
r, loadbalance, ns, defaultLoad, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
r, loadbalance, ns, defaultLoad, timeout, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -131,6 +134,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
require.False(t, r.Qemu.Install)
|
||||
require.Equal(t, bkimage.QemuImage, r.Qemu.Image)
|
||||
require.False(t, defaultLoad)
|
||||
require.Equal(t, 120*time.Second, timeout)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -141,7 +145,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
"loadbalance": "sticky",
|
||||
}
|
||||
|
||||
r, loadbalance, ns, defaultLoad, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
r, loadbalance, ns, defaultLoad, timeout, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -161,6 +165,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
require.False(t, r.Qemu.Install)
|
||||
require.Equal(t, bkimage.QemuImage, r.Qemu.Image)
|
||||
require.False(t, defaultLoad)
|
||||
require.Equal(t, 120*time.Second, timeout)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -169,7 +174,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
cfg.DriverOpts = map[string]string{
|
||||
"replicas": "invalid",
|
||||
}
|
||||
_, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
_, _, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
require.Error(t, err)
|
||||
},
|
||||
)
|
||||
@@ -179,7 +184,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
cfg.DriverOpts = map[string]string{
|
||||
"rootless": "invalid",
|
||||
}
|
||||
_, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
_, _, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
require.Error(t, err)
|
||||
},
|
||||
)
|
||||
@@ -189,7 +194,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
cfg.DriverOpts = map[string]string{
|
||||
"tolerations": "key=foo,value=bar,invalid=foo2",
|
||||
}
|
||||
_, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
_, _, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
require.Error(t, err)
|
||||
},
|
||||
)
|
||||
@@ -199,7 +204,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
cfg.DriverOpts = map[string]string{
|
||||
"tolerations": "key=foo,value=bar,tolerationSeconds=invalid",
|
||||
}
|
||||
_, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
_, _, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
require.Error(t, err)
|
||||
},
|
||||
)
|
||||
@@ -209,7 +214,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
cfg.DriverOpts = map[string]string{
|
||||
"annotations": "key,value",
|
||||
}
|
||||
_, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
_, _, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
require.Error(t, err)
|
||||
},
|
||||
)
|
||||
@@ -219,7 +224,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
cfg.DriverOpts = map[string]string{
|
||||
"labels": "key=value=foo",
|
||||
}
|
||||
_, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
_, _, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
require.Error(t, err)
|
||||
},
|
||||
)
|
||||
@@ -229,7 +234,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
cfg.DriverOpts = map[string]string{
|
||||
"loadbalance": "invalid",
|
||||
}
|
||||
_, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
_, _, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
require.Error(t, err)
|
||||
},
|
||||
)
|
||||
@@ -239,7 +244,7 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
cfg.DriverOpts = map[string]string{
|
||||
"qemu.install": "invalid",
|
||||
}
|
||||
_, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
_, _, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
require.Error(t, err)
|
||||
},
|
||||
)
|
||||
@@ -249,7 +254,17 @@ func TestFactory_processDriverOpts(t *testing.T) {
|
||||
cfg.DriverOpts = map[string]string{
|
||||
"invalid": "foo",
|
||||
}
|
||||
_, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
_, _, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
require.Error(t, err)
|
||||
},
|
||||
)
|
||||
|
||||
t.Run(
|
||||
"InvalidTimeout", func(t *testing.T) {
|
||||
cfg.DriverOpts = map[string]string{
|
||||
"timeout": "invalid",
|
||||
}
|
||||
_, _, _, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg)
|
||||
require.Error(t, err)
|
||||
},
|
||||
)
|
||||
|
@@ -20,6 +20,7 @@ type DeploymentOpt struct {
|
||||
Image string
|
||||
Replicas int
|
||||
ServiceAccountName string
|
||||
SchedulerName string
|
||||
|
||||
// Qemu
|
||||
Qemu struct {
|
||||
@@ -107,6 +108,7 @@ func NewDeployment(opt *DeploymentOpt) (d *appsv1.Deployment, c []*corev1.Config
|
||||
},
|
||||
Spec: corev1.PodSpec{
|
||||
ServiceAccountName: opt.ServiceAccountName,
|
||||
SchedulerName: opt.SchedulerName,
|
||||
Containers: []corev1.Container{
|
||||
{
|
||||
Name: containerName,
|
||||
@@ -146,13 +148,13 @@ func NewDeployment(opt *DeploymentOpt) (d *appsv1.Deployment, c []*corev1.Config
|
||||
Data: cfg.files,
|
||||
}
|
||||
|
||||
d.Spec.Template.Spec.Containers[0].VolumeMounts = []corev1.VolumeMount{{
|
||||
d.Spec.Template.Spec.Containers[0].VolumeMounts = append(d.Spec.Template.Spec.Containers[0].VolumeMounts, corev1.VolumeMount{
|
||||
Name: cfg.name,
|
||||
MountPath: path.Join("/etc/buildkit", cfg.path),
|
||||
}}
|
||||
})
|
||||
|
||||
d.Spec.Template.Spec.Volumes = []corev1.Volume{{
|
||||
Name: "config",
|
||||
d.Spec.Template.Spec.Volumes = append(d.Spec.Template.Spec.Volumes, corev1.Volume{
|
||||
Name: cfg.name,
|
||||
VolumeSource: corev1.VolumeSource{
|
||||
ConfigMap: &corev1.ConfigMapVolumeSource{
|
||||
LocalObjectReference: corev1.LocalObjectReference{
|
||||
@@ -160,7 +162,7 @@ func NewDeployment(opt *DeploymentOpt) (d *appsv1.Deployment, c []*corev1.Config
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
})
|
||||
c = append(c, cc)
|
||||
}
|
||||
|
||||
|
@@ -1,12 +1,13 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
|
||||
"github.com/docker/buildx/store"
|
||||
"github.com/google/uuid"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/apiserver/pkg/storage/names"
|
||||
)
|
||||
|
||||
func GenerateNodeName(builderName string, txn *store.Txn) (string, error) {
|
||||
@@ -15,7 +16,7 @@ func GenerateNodeName(builderName string, txn *store.Txn) (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return names.SimpleNameGenerator.GenerateName(fmt.Sprintf("buildkit-%s-", u)), nil
|
||||
return generateName(fmt.Sprintf("buildkit-%s-", u)), nil
|
||||
}
|
||||
|
||||
ng, err := txn.NodeGroupByName(builderName)
|
||||
@@ -45,3 +46,30 @@ func GenerateNodeName(builderName string, txn *store.Txn) (string, error) {
|
||||
|
||||
return "", errors.Errorf("failed to generate random node name")
|
||||
}
|
||||
|
||||
const (
|
||||
maxNameLength = 63
|
||||
randomLength = 5
|
||||
maxGeneratedNameLength = maxNameLength - randomLength
|
||||
)
|
||||
|
||||
// generateName generates the name plus a random suffix of five alphanumerics
|
||||
// when a name is requested. The string is guaranteed to not exceed the length
|
||||
// of a standard Kubernetes name (63 characters).
|
||||
//
|
||||
// It's a simplified implementation of k8s.io/apiserver/pkg/storage/names:
|
||||
// https://github.com/kubernetes/apiserver/blob/v0.29.2/pkg/storage/names/generate.go#L34-L54
|
||||
func generateName(base string) string {
|
||||
if len(base) > maxGeneratedNameLength {
|
||||
base = base[:maxGeneratedNameLength]
|
||||
}
|
||||
return base + randomSuffix()
|
||||
}
|
||||
|
||||
func randomSuffix() string {
|
||||
b := make([]byte, 32)
|
||||
if _, err := rand.Read(b); err != nil {
|
||||
panic(err) // This shouldn't happen
|
||||
}
|
||||
return hex.EncodeToString(b)[:randomLength]
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
dockerclient "github.com/docker/docker/client"
|
||||
"github.com/moby/buildkit/client"
|
||||
"github.com/moby/buildkit/util/tracing/detect"
|
||||
"github.com/moby/buildkit/util/tracing/delegated"
|
||||
specs "github.com/opencontainers/image-spec/specs-go/v1"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/client-go/rest"
|
||||
@@ -157,26 +157,15 @@ type DriverHandle struct {
|
||||
|
||||
func (d *DriverHandle) Client(ctx context.Context) (*client.Client, error) {
|
||||
d.once.Do(func() {
|
||||
opts, err := d.getClientOptions()
|
||||
if err != nil {
|
||||
d.err = err
|
||||
return
|
||||
}
|
||||
d.client, d.err = d.Driver.Client(ctx, opts...)
|
||||
d.client, d.err = d.Driver.Client(ctx, d.getClientOptions()...)
|
||||
})
|
||||
return d.client, d.err
|
||||
}
|
||||
|
||||
func (d *DriverHandle) getClientOptions() ([]client.ClientOpt, error) {
|
||||
exp, _, err := detect.Exporter()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if td, ok := exp.(client.TracerDelegate); ok {
|
||||
return []client.ClientOpt{
|
||||
client.WithTracerDelegate(td),
|
||||
}, nil
|
||||
func (d *DriverHandle) getClientOptions() []client.ClientOpt {
|
||||
return []client.ClientOpt{
|
||||
client.WithTracerDelegate(delegated.DefaultExporter),
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (d *DriverHandle) HistoryAPISupported(ctx context.Context) bool {
|
||||
|
38
go.mod
38
go.mod
@@ -4,19 +4,20 @@ go 1.21
|
||||
|
||||
require (
|
||||
github.com/Masterminds/semver/v3 v3.2.1
|
||||
github.com/Microsoft/go-winio v0.6.1
|
||||
github.com/Microsoft/go-winio v0.6.2
|
||||
github.com/aws/aws-sdk-go-v2/config v1.26.6
|
||||
github.com/compose-spec/compose-go/v2 v2.0.2
|
||||
github.com/compose-spec/compose-go/v2 v2.1.2
|
||||
github.com/containerd/console v1.0.4
|
||||
github.com/containerd/containerd v1.7.15
|
||||
github.com/containerd/containerd v1.7.18
|
||||
github.com/containerd/continuity v0.4.3
|
||||
github.com/containerd/errdefs v0.1.0
|
||||
github.com/containerd/log v0.1.0
|
||||
github.com/containerd/typeurl/v2 v2.1.1
|
||||
github.com/creack/pty v1.1.18
|
||||
github.com/distribution/reference v0.5.0
|
||||
github.com/docker/cli v26.0.1-0.20240410153731-b6c552212837+incompatible // v26.1.0-dev
|
||||
github.com/creack/pty v1.1.21
|
||||
github.com/distribution/reference v0.6.0
|
||||
github.com/docker/cli v26.1.4+incompatible
|
||||
github.com/docker/cli-docs-tool v0.7.0
|
||||
github.com/docker/docker v26.0.0+incompatible
|
||||
github.com/docker/docker v26.1.4+incompatible
|
||||
github.com/docker/go-units v0.5.0
|
||||
github.com/gofrs/flock v0.8.1
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
@@ -26,12 +27,12 @@ require (
|
||||
github.com/hashicorp/go-cty-funcs v0.0.0-20230405223818-a090f58aa992
|
||||
github.com/hashicorp/hcl/v2 v2.20.1
|
||||
github.com/in-toto/in-toto-golang v0.5.0
|
||||
github.com/moby/buildkit v0.13.0-rc3.0.20240411143343-549891b34890 // v0.14.0-dev
|
||||
github.com/moby/buildkit v0.14.1
|
||||
github.com/moby/sys/mountinfo v0.7.1
|
||||
github.com/moby/sys/signal v0.7.0
|
||||
github.com/morikuni/aec v1.0.0
|
||||
github.com/opencontainers/go-digest v1.0.0
|
||||
github.com/opencontainers/image-spec v1.1.0-rc5
|
||||
github.com/opencontainers/image-spec v1.1.0
|
||||
github.com/pelletier/go-toml v1.9.5
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b
|
||||
@@ -39,27 +40,28 @@ require (
|
||||
github.com/spf13/cobra v1.8.0
|
||||
github.com/spf13/pflag v1.0.5
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/tonistiigi/fsutil v0.0.0-20240301111122-7525a1af2bb5
|
||||
github.com/tonistiigi/fsutil v0.0.0-20240424095704-91a3fc46842c
|
||||
github.com/zclconf/go-cty v1.14.4
|
||||
go.opentelemetry.io/otel v1.21.0
|
||||
go.opentelemetry.io/otel/metric v1.21.0
|
||||
go.opentelemetry.io/otel/sdk v1.21.0
|
||||
go.opentelemetry.io/otel/trace v1.21.0
|
||||
golang.org/x/mod v0.14.0
|
||||
golang.org/x/mod v0.17.0
|
||||
golang.org/x/sync v0.6.0
|
||||
golang.org/x/sys v0.18.0
|
||||
golang.org/x/term v0.18.0
|
||||
golang.org/x/text v0.14.0
|
||||
google.golang.org/grpc v1.59.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
k8s.io/api v0.29.2
|
||||
k8s.io/apimachinery v0.29.2
|
||||
k8s.io/apiserver v0.29.2
|
||||
k8s.io/client-go v0.29.2
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
|
||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
|
||||
github.com/Microsoft/hcsshim v0.11.4 // indirect
|
||||
github.com/Microsoft/hcsshim v0.11.5 // indirect
|
||||
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d // indirect
|
||||
github.com/agext/levenshtein v1.2.3 // indirect
|
||||
github.com/apparentlymart/go-cidr v1.0.1 // indirect
|
||||
@@ -79,7 +81,7 @@ require (
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/containerd/ttrpc v1.2.3 // indirect
|
||||
github.com/containerd/ttrpc v1.2.4 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/docker/distribution v2.8.2+incompatible // indirect
|
||||
github.com/docker/docker-credential-helpers v0.8.0 // indirect
|
||||
@@ -94,6 +96,7 @@ require (
|
||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||
github.com/go-openapi/swag v0.22.3 // indirect
|
||||
github.com/go-viper/mapstructure/v2 v2.0.0 // indirect
|
||||
github.com/gogo/googleapis v1.4.1 // indirect
|
||||
github.com/google/gnostic-models v0.6.8 // indirect
|
||||
github.com/google/go-cmp v0.6.0 // indirect
|
||||
@@ -101,7 +104,9 @@ require (
|
||||
github.com/gorilla/mux v1.8.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/imdario/mergo v0.3.16 // indirect
|
||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||
github.com/josharian/intern v1.0.0 // indirect
|
||||
@@ -137,7 +142,7 @@ require (
|
||||
github.com/shibumi/go-pathspec v1.3.0 // indirect
|
||||
github.com/theupdateframework/notary v0.7.0 // indirect
|
||||
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect
|
||||
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 // indirect
|
||||
github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect
|
||||
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
|
||||
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
|
||||
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
|
||||
@@ -150,15 +155,12 @@ require (
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/prometheus v0.42.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
|
||||
golang.org/x/crypto v0.21.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 // indirect
|
||||
golang.org/x/net v0.23.0 // indirect
|
||||
golang.org/x/oauth2 v0.11.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
golang.org/x/time v0.3.0 // indirect
|
||||
golang.org/x/tools v0.17.0 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
|
69
go.sum
69
go.sum
@@ -13,10 +13,10 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0=
|
||||
github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
|
||||
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
|
||||
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
|
||||
github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=
|
||||
github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w=
|
||||
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
|
||||
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
|
||||
github.com/Microsoft/hcsshim v0.11.5 h1:haEcLNpj9Ka1gd3B3tAEs9CpE0c+1IhoL59w/exYU38=
|
||||
github.com/Microsoft/hcsshim v0.11.5/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU=
|
||||
github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
|
||||
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs=
|
||||
github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ=
|
||||
@@ -84,16 +84,18 @@ github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+g
|
||||
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE=
|
||||
github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4=
|
||||
github.com/compose-spec/compose-go/v2 v2.0.2 h1:zhXMV7VWI00Su0LdKt8/sxeXxcjLWhmGmpEyw+ZYznI=
|
||||
github.com/compose-spec/compose-go/v2 v2.0.2/go.mod h1:bEPizBkIojlQ20pi2vNluBa58tevvj0Y18oUSHPyfdc=
|
||||
github.com/compose-spec/compose-go/v2 v2.1.2 h1:N2XmNYg5jHNBaU+4/zSAe2UrZLq7Kkp1eSsOHfAHbxQ=
|
||||
github.com/compose-spec/compose-go/v2 v2.1.2/go.mod h1:NJGRGazJfh0tD7d13h66KDVvyOHK49Wil2CIhoffiD0=
|
||||
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
|
||||
github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw=
|
||||
github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro=
|
||||
github.com/containerd/console v1.0.4/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=
|
||||
github.com/containerd/containerd v1.7.15 h1:afEHXdil9iAm03BmhjzKyXnnEBtjaLJefdU7DV0IFes=
|
||||
github.com/containerd/containerd v1.7.15/go.mod h1:ISzRRTMF8EXNpJlTzyr2XMhN+j9K302C21/+cr3kUnY=
|
||||
github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao=
|
||||
github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4=
|
||||
github.com/containerd/continuity v0.4.3 h1:6HVkalIp+2u1ZLH1J/pYX2oBVXlJZvh1X1A7bEZ9Su8=
|
||||
github.com/containerd/continuity v0.4.3/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ=
|
||||
github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM=
|
||||
github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0=
|
||||
github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY=
|
||||
github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o=
|
||||
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
|
||||
@@ -103,29 +105,29 @@ github.com/containerd/nydus-snapshotter v0.13.7/go.mod h1:VPVKQ3jmHFIcUIV2yiQ1kI
|
||||
github.com/containerd/stargz-snapshotter v0.15.1 h1:fpsP4kf/Z4n2EYnU0WT8ZCE3eiKDwikDhL6VwxIlgeA=
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU=
|
||||
github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk=
|
||||
github.com/containerd/ttrpc v1.2.3 h1:4jlhbXIGvijRtNC8F/5CpuJZ7yKOBFGFOOXg1bkISz0=
|
||||
github.com/containerd/ttrpc v1.2.3/go.mod h1:ieWsXucbb8Mj9PH0rXCw1i8IunRbbAiDkpXkbfflWBM=
|
||||
github.com/containerd/ttrpc v1.2.4 h1:eQCQK4h9dxDmpOb9QOOMh2NHTfzroH1IkmHiKZi05Oo=
|
||||
github.com/containerd/ttrpc v1.2.4/go.mod h1:ojvb8SJBSch0XkqNO0L0YX/5NxR3UnVk2LzFKBK0upc=
|
||||
github.com/containerd/typeurl/v2 v2.1.1 h1:3Q4Pt7i8nYwy2KmQWIw2+1hTvwTE/6w9FqcttATPO/4=
|
||||
github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
|
||||
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
|
||||
github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0=
|
||||
github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
|
||||
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
|
||||
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
||||
github.com/docker/cli v26.0.1-0.20240410153731-b6c552212837+incompatible h1:KTmSJjZSQM+cpaczHecGsBNlgJtRccef/62pCOeiA9o=
|
||||
github.com/docker/cli v26.0.1-0.20240410153731-b6c552212837+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
||||
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
|
||||
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
|
||||
github.com/docker/cli v26.1.4+incompatible h1:I8PHdc0MtxEADqYJZvhBrW9bo8gawKwwenxRM7/rLu8=
|
||||
github.com/docker/cli v26.1.4+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8=
|
||||
github.com/docker/cli-docs-tool v0.7.0 h1:M2Da98Unz2kz3A5d4yeSGbhyOge2mfYSNjAFt01Rw0M=
|
||||
github.com/docker/cli-docs-tool v0.7.0/go.mod h1:zMjqTFCU361PRh8apiXzeAZ1Q/xupbIwTusYpzCXS/o=
|
||||
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
|
||||
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
|
||||
github.com/docker/docker v26.0.0+incompatible h1:Ng2qi+gdKADUa/VM+6b6YaY2nlZhk/lVJiKR/2bMudU=
|
||||
github.com/docker/docker v26.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||
github.com/docker/docker v26.1.4+incompatible h1:vuTpXDuoga+Z38m1OZHzl7NKisKWaWlhjQk7IDPSLsU=
|
||||
github.com/docker/docker v26.1.4+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
|
||||
github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8=
|
||||
github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40=
|
||||
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=
|
||||
@@ -174,6 +176,8 @@ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEe
|
||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
|
||||
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
|
||||
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc=
|
||||
github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
|
||||
github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
|
||||
github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU=
|
||||
github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
|
||||
@@ -225,10 +229,15 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rH
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg=
|
||||
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=
|
||||
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-cty-funcs v0.0.0-20230405223818-a090f58aa992 h1:fYOrSfO5C9PmFGtmRWSYGqq52SOoE2dXMtAn2Xzh1LQ=
|
||||
github.com/hashicorp/go-cty-funcs v0.0.0-20230405223818-a090f58aa992/go.mod h1:Abjk0jbRkDaNCzsRhOv2iDCofYpX1eVsjozoiK63qLA=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/hcl/v2 v2.20.1 h1:M6hgdyz7HYt1UN9e61j+qKJBqR3orTWbI1HKBJEdxtc=
|
||||
github.com/hashicorp/hcl/v2 v2.20.1/go.mod h1:TZDqQ4kNKCbh1iJp99FdPiUaVDDUPivbqxZulxDYqL4=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
@@ -293,8 +302,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
|
||||
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
|
||||
github.com/moby/buildkit v0.13.0-rc3.0.20240411143343-549891b34890 h1:ikD8s7J6fN9kme4Yq1nUKlpZhEnakiMEcN9XeKFZXbs=
|
||||
github.com/moby/buildkit v0.13.0-rc3.0.20240411143343-549891b34890/go.mod h1:iqJg3dy9wLt5maCeC8WBbDISnLvuSX+R9jVNzg2zACU=
|
||||
github.com/moby/buildkit v0.14.1 h1:2epLCZTkn4CikdImtsLtIa++7DzCimrrZCT1sway+oI=
|
||||
github.com/moby/buildkit v0.14.1/go.mod h1:1XssG7cAqv5Bz1xcGMxJL123iCv5TYN4Z/qf647gfuk=
|
||||
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
|
||||
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
|
||||
github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg=
|
||||
@@ -341,8 +350,8 @@ github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1
|
||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
||||
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
|
||||
github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI=
|
||||
github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
|
||||
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
|
||||
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
|
||||
github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg=
|
||||
github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
|
||||
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
|
||||
@@ -426,12 +435,12 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4DzbAiAiEL3c=
|
||||
github.com/theupdateframework/notary v0.7.0/go.mod h1:c9DRxcmhHmVLDay4/2fUYdISnHqbFDGRSlXPO0AhYWw=
|
||||
github.com/tonistiigi/fsutil v0.0.0-20240301111122-7525a1af2bb5 h1:oZS8KCqAg62sxJkEq/Ppzqrb6EooqzWtL8Oaex7bc5c=
|
||||
github.com/tonistiigi/fsutil v0.0.0-20240301111122-7525a1af2bb5/go.mod h1:vbbYqJlnswsbJqWUcJN8fKtBhnEgldDrcagTgnBVKKM=
|
||||
github.com/tonistiigi/fsutil v0.0.0-20240424095704-91a3fc46842c h1:+6wg/4ORAbnSoGDzg2Q1i3CeMcT/jjhye/ZfnBHy7/M=
|
||||
github.com/tonistiigi/fsutil v0.0.0-20240424095704-91a3fc46842c/go.mod h1:vbbYqJlnswsbJqWUcJN8fKtBhnEgldDrcagTgnBVKKM=
|
||||
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0=
|
||||
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk=
|
||||
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 h1:Y/M5lygoNPKwVNLMPXgVfsRT40CSFKXCxuU8LoHySjs=
|
||||
github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc=
|
||||
github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab h1:H6aJ0yKQ0gF49Qb2z5hI1UHxSQt4JMyxebFR15KnApw=
|
||||
github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc=
|
||||
github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts=
|
||||
github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk=
|
||||
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
|
||||
@@ -471,8 +480,6 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqhe
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 h1:digkEZCJWobwBqMwC0cwCq8/wkkRy/OowZg5OArWZrM=
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0/go.mod h1:/OpE/y70qVkndM0TrxT4KBoN3RsFZP0QaofcfYrj76I=
|
||||
go.opentelemetry.io/otel/exporters/prometheus v0.42.0 h1:jwV9iQdvp38fxXi8ZC+lNpxjK16MRcZlpDYvbuO1FiA=
|
||||
go.opentelemetry.io/otel/exporters/prometheus v0.42.0/go.mod h1:f3bYiqNqhoPxkvI2LrXqQVC546K7BuRDL/kKuxkujhA=
|
||||
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
|
||||
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
|
||||
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
|
||||
@@ -499,8 +506,8 @@ golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu
|
||||
golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
|
||||
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
@@ -604,8 +611,6 @@ k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A=
|
||||
k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0=
|
||||
k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8=
|
||||
k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU=
|
||||
k8s.io/apiserver v0.29.2 h1:+Z9S0dSNr+CjnVXQePG8TcBWHr3Q7BmAr7NraHvsMiQ=
|
||||
k8s.io/apiserver v0.29.2/go.mod h1:B0LieKVoyU7ykQvPFm7XSdIHaCHSzCzQWPFa5bqbeMQ=
|
||||
k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg=
|
||||
k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA=
|
||||
k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0=
|
||||
|
@@ -2,11 +2,18 @@
|
||||
|
||||
ARG GO_VERSION=1.21
|
||||
ARG XX_VERSION=1.3.0
|
||||
ARG GOLANGCI_LINT_VERSION=1.54.2
|
||||
ARG GOLANGCI_LINT_VERSION=1.57.2
|
||||
ARG GOPLS_VERSION=v0.20.0
|
||||
# disabled: deprecated unusedvariable simplifyrange
|
||||
ARG GOPLS_ANALYZERS="embeddirective fillreturns infertypeargs nonewvars noresultvalues simplifycompositelit simplifyslice stubmethods undeclaredname unusedparams useany"
|
||||
|
||||
|
||||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
|
||||
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine
|
||||
|
||||
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS golang-base
|
||||
RUN apk add --no-cache git gcc musl-dev
|
||||
|
||||
FROM golang-base AS lint
|
||||
ENV GOFLAGS="-buildvcs=false"
|
||||
ARG GOLANGCI_LINT_VERSION
|
||||
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v${GOLANGCI_LINT_VERSION}
|
||||
@@ -17,3 +24,49 @@ RUN --mount=target=/go/src/github.com/docker/buildx \
|
||||
--mount=target=/root/.cache,type=cache,id=lint-cache-$TARGETPLATFORM \
|
||||
xx-go --wrap && \
|
||||
golangci-lint run
|
||||
|
||||
FROM golang-base AS gopls
|
||||
RUN apk add --no-cache git
|
||||
ARG GOPLS_VERSION
|
||||
WORKDIR /src
|
||||
RUN git clone https://github.com/golang/tools.git && \
|
||||
cd tools && git checkout ${GOPLS_VERSION}
|
||||
WORKDIR tools/gopls
|
||||
ARG GOPLS_ANALYZERS
|
||||
RUN <<'EOF'
|
||||
set -ex
|
||||
mkdir -p /out
|
||||
for analyzer in ${GOPLS_ANALYZERS}; do
|
||||
mkdir -p internal/cmd/$analyzer
|
||||
cat <<eot > internal/cmd/$analyzer/main.go
|
||||
package main
|
||||
|
||||
import (
|
||||
"golang.org/x/tools/go/analysis/singlechecker"
|
||||
analyzer "golang.org/x/tools/gopls/internal/analysis/$analyzer"
|
||||
)
|
||||
|
||||
func main() { singlechecker.Main(analyzer.Analyzer) }
|
||||
eot
|
||||
echo "Analyzing with ${analyzer}..."
|
||||
go build -o /out/$analyzer ./internal/cmd/$analyzer
|
||||
done
|
||||
EOF
|
||||
|
||||
FROM golang-base AS gopls-analyze
|
||||
COPY --link --from=xx / /
|
||||
ARG GOPLS_ANALYZERS
|
||||
ARG TARGETNAME
|
||||
ARG TARGETPLATFORM
|
||||
WORKDIR /go/src/github.com/docker/buildx
|
||||
RUN --mount=target=. \
|
||||
--mount=target=/root/.cache,type=cache,id=lint-cache-${TARGETNAME}-${TARGETPLATFORM} \
|
||||
--mount=target=/gopls-analyzers,from=gopls,source=/out <<EOF
|
||||
set -ex
|
||||
xx-go --wrap
|
||||
for analyzer in ${GOPLS_ANALYZERS}; do
|
||||
go vet -vettool=/gopls-analyzers/$analyzer ./...
|
||||
done
|
||||
EOF
|
||||
|
||||
FROM lint
|
137
tests/build.go
137
tests/build.go
@@ -16,6 +16,9 @@ import (
|
||||
"github.com/containerd/containerd/platforms"
|
||||
"github.com/containerd/continuity/fs/fstest"
|
||||
"github.com/creack/pty"
|
||||
"github.com/moby/buildkit/frontend/subrequests/lint"
|
||||
"github.com/moby/buildkit/frontend/subrequests/outline"
|
||||
"github.com/moby/buildkit/frontend/subrequests/targets"
|
||||
"github.com/moby/buildkit/identity"
|
||||
provenancetypes "github.com/moby/buildkit/solver/llbsolver/provenance/types"
|
||||
"github.com/moby/buildkit/util/appdefaults"
|
||||
@@ -61,6 +64,7 @@ var buildTests = []func(t *testing.T, sb integration.Sandbox){
|
||||
testBuildLoadPush,
|
||||
testBuildSecret,
|
||||
testBuildDefaultLoad,
|
||||
testBuildPrint,
|
||||
}
|
||||
|
||||
func testBuild(t *testing.T, sb integration.Sandbox) {
|
||||
@@ -793,6 +797,139 @@ func testBuildDefaultLoad(t *testing.T, sb integration.Sandbox) {
|
||||
require.NoError(t, cmd.Run())
|
||||
}
|
||||
|
||||
func testBuildPrint(t *testing.T, sb integration.Sandbox) {
|
||||
if !isExperimental() {
|
||||
t.Skip("experimental mode required, skipping")
|
||||
}
|
||||
|
||||
t.Run("lint", func(t *testing.T) {
|
||||
dockerfile := []byte(`
|
||||
frOM busybox as base
|
||||
cOpy Dockerfile .
|
||||
from scratch
|
||||
COPy --from=base \
|
||||
/Dockerfile \
|
||||
/
|
||||
`)
|
||||
dir := tmpdir(
|
||||
t,
|
||||
fstest.CreateFile("Dockerfile", dockerfile, 0600),
|
||||
)
|
||||
|
||||
cmd := buildxCmd(sb, withArgs("build", "--print=lint,format=json", dir))
|
||||
stdout := bytes.Buffer{}
|
||||
stderr := bytes.Buffer{}
|
||||
cmd.Stdout = &stdout
|
||||
cmd.Stderr = &stderr
|
||||
require.Error(t, cmd.Run(), stdout.String(), stderr.String())
|
||||
|
||||
var res lint.LintResults
|
||||
require.NoError(t, json.Unmarshal(stdout.Bytes(), &res))
|
||||
require.Equal(t, 3, len(res.Warnings))
|
||||
})
|
||||
|
||||
t.Run("outline", func(t *testing.T) {
|
||||
dockerfile := []byte(`
|
||||
FROM busybox AS first
|
||||
RUN --mount=type=secret,target=/etc/passwd,required=true --mount=type=ssh true
|
||||
|
||||
FROM alpine AS second
|
||||
RUN --mount=type=secret,id=unused --mount=type=ssh,id=ssh2 true
|
||||
|
||||
FROM scratch AS third
|
||||
ARG BAR
|
||||
RUN --mount=type=secret,id=second${BAR} true
|
||||
|
||||
FROM third AS target
|
||||
COPY --from=first /foo /
|
||||
RUN --mount=type=ssh,id=ssh3,required true
|
||||
|
||||
FROM second
|
||||
`)
|
||||
dir := tmpdir(
|
||||
t,
|
||||
fstest.CreateFile("Dockerfile", dockerfile, 0600),
|
||||
)
|
||||
|
||||
cmd := buildxCmd(sb, withArgs("build", "--build-arg=BAR=678", "--target=target", "--print=outline,format=json", dir))
|
||||
stdout := bytes.Buffer{}
|
||||
stderr := bytes.Buffer{}
|
||||
cmd.Stdout = &stdout
|
||||
cmd.Stderr = &stderr
|
||||
require.NoError(t, cmd.Run(), stdout.String(), stderr.String())
|
||||
|
||||
var res outline.Outline
|
||||
require.NoError(t, json.Unmarshal(stdout.Bytes(), &res))
|
||||
assert.Equal(t, "target", res.Name)
|
||||
|
||||
require.Equal(t, 1, len(res.Args))
|
||||
assert.Equal(t, "BAR", res.Args[0].Name)
|
||||
assert.Equal(t, "678", res.Args[0].Value)
|
||||
|
||||
require.Equal(t, 2, len(res.Secrets))
|
||||
assert.Equal(t, "passwd", res.Secrets[0].Name)
|
||||
assert.Equal(t, true, res.Secrets[0].Required)
|
||||
assert.Equal(t, "second678", res.Secrets[1].Name)
|
||||
assert.Equal(t, false, res.Secrets[1].Required)
|
||||
|
||||
require.Equal(t, 2, len(res.SSH))
|
||||
assert.Equal(t, "default", res.SSH[0].Name)
|
||||
assert.Equal(t, false, res.SSH[0].Required)
|
||||
assert.Equal(t, "ssh3", res.SSH[1].Name)
|
||||
assert.Equal(t, true, res.SSH[1].Required)
|
||||
|
||||
require.Equal(t, 1, len(res.Sources))
|
||||
})
|
||||
|
||||
t.Run("targets", func(t *testing.T) {
|
||||
dockerfile := []byte(`
|
||||
# build defines stage for compiling the binary
|
||||
FROM alpine AS build
|
||||
RUN true
|
||||
|
||||
FROM busybox as second
|
||||
RUN false
|
||||
|
||||
FROM alpine
|
||||
RUN false
|
||||
|
||||
# binary returns the compiled binary
|
||||
FROM second AS binary
|
||||
`)
|
||||
dir := tmpdir(
|
||||
t,
|
||||
fstest.CreateFile("Dockerfile", dockerfile, 0600),
|
||||
)
|
||||
|
||||
cmd := buildxCmd(sb, withArgs("build", "--print=targets,format=json", dir))
|
||||
stdout := bytes.Buffer{}
|
||||
stderr := bytes.Buffer{}
|
||||
cmd.Stdout = &stdout
|
||||
cmd.Stderr = &stderr
|
||||
require.NoError(t, cmd.Run(), stdout.String(), stderr.String())
|
||||
|
||||
var res targets.List
|
||||
require.NoError(t, json.Unmarshal(stdout.Bytes(), &res))
|
||||
|
||||
require.Equal(t, 4, len(res.Targets))
|
||||
assert.Equal(t, "build", res.Targets[0].Name)
|
||||
assert.Equal(t, "defines stage for compiling the binary", res.Targets[0].Description)
|
||||
assert.Equal(t, "alpine", res.Targets[0].Base)
|
||||
assert.Equal(t, "second", res.Targets[1].Name)
|
||||
assert.Empty(t, res.Targets[1].Description)
|
||||
assert.Equal(t, "busybox", res.Targets[1].Base)
|
||||
assert.Empty(t, res.Targets[2].Name)
|
||||
assert.Empty(t, res.Targets[2].Description)
|
||||
assert.Equal(t, "alpine", res.Targets[2].Base)
|
||||
assert.Equal(t, "binary", res.Targets[3].Name)
|
||||
assert.Equal(t, "returns the compiled binary", res.Targets[3].Description)
|
||||
assert.Equal(t, "second", res.Targets[3].Base)
|
||||
assert.Equal(t, true, res.Targets[3].Default)
|
||||
|
||||
require.Equal(t, 1, len(res.Sources))
|
||||
})
|
||||
}
|
||||
|
||||
func createTestProject(t *testing.T) string {
|
||||
dockerfile := []byte(`
|
||||
FROM busybox:latest AS base
|
||||
|
@@ -113,13 +113,10 @@ func testDialStdio(t *testing.T, sb integration.Sandbox) {
|
||||
require.Equal(t, "world", string(dt))
|
||||
}
|
||||
|
||||
t.Run("conn=netpipe", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
do(t, func(t *testing.T, cmd *exec.Cmd) net.Conn {
|
||||
c1, c2 := net.Pipe()
|
||||
cmd.Stdin = c1
|
||||
cmd.Stdout = c1
|
||||
return c2
|
||||
})
|
||||
do(t, func(t *testing.T, cmd *exec.Cmd) net.Conn {
|
||||
c1, c2 := net.Pipe()
|
||||
cmd.Stdin = c1
|
||||
cmd.Stdout = c1
|
||||
return c2
|
||||
})
|
||||
}
|
||||
|
@@ -78,6 +78,19 @@ func testImagetoolsCopyManifest(t *testing.T, sb integration.Sandbox) {
|
||||
for i := range mfst.Layers {
|
||||
require.Equal(t, mfst.Layers[i].Digest, mfst2.Layers[i].Digest)
|
||||
}
|
||||
|
||||
cmd = buildxCmd(sb, withArgs("imagetools", "create", "--prefer-index=false", "-t", target2+"-not-index", target))
|
||||
dt, err = cmd.CombinedOutput()
|
||||
require.NoError(t, err, string(dt))
|
||||
|
||||
cmd = buildxCmd(sb, withArgs("imagetools", "inspect", target2+"-not-index", "--raw"))
|
||||
dt, err = cmd.CombinedOutput()
|
||||
require.NoError(t, err, string(dt))
|
||||
|
||||
var idx3 ocispecs.Manifest
|
||||
err = json.Unmarshal(dt, &idx3)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, images.MediaTypeDockerSchema2Manifest, idx3.MediaType)
|
||||
}
|
||||
|
||||
func testImagetoolsCopyIndex(t *testing.T, sb integration.Sandbox) {
|
||||
@@ -127,6 +140,24 @@ func testImagetoolsCopyIndex(t *testing.T, sb integration.Sandbox) {
|
||||
for i := range idx.Manifests {
|
||||
require.Equal(t, idx.Manifests[i].Digest, idx2.Manifests[i].Digest)
|
||||
}
|
||||
|
||||
cmd = buildxCmd(sb, withArgs("imagetools", "create", "--prefer-index=false", "-t", target2+"-still-index", target))
|
||||
dt, err = cmd.CombinedOutput()
|
||||
require.NoError(t, err, string(dt))
|
||||
|
||||
cmd = buildxCmd(sb, withArgs("imagetools", "inspect", target2+"-still-index", "--raw"))
|
||||
dt, err = cmd.CombinedOutput()
|
||||
require.NoError(t, err, string(dt))
|
||||
|
||||
var idx3 ocispecs.Index
|
||||
err = json.Unmarshal(dt, &idx3)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, images.MediaTypeDockerSchema2ManifestList, idx3.MediaType)
|
||||
|
||||
require.Equal(t, len(idx.Manifests), len(idx3.Manifests))
|
||||
for i := range idx.Manifests {
|
||||
require.Equal(t, idx.Manifests[i].Digest, idx3.Manifests[i].Digest)
|
||||
}
|
||||
}
|
||||
|
||||
func testImagetoolsInspectAndFilter(t *testing.T, sb integration.Sandbox) {
|
||||
|
@@ -60,12 +60,9 @@ func (c dockerWorker) New(ctx context.Context, cfg *integration.BackendConfig) (
|
||||
}
|
||||
|
||||
cl = func() error {
|
||||
var err error
|
||||
if err1 := bkclose(); err == nil {
|
||||
err = err1
|
||||
}
|
||||
err := bkclose()
|
||||
cmd := exec.Command("docker", "context", "rm", "-f", name)
|
||||
if err1 := cmd.Run(); err1 != nil {
|
||||
if err1 := cmd.Run(); err == nil {
|
||||
err = errors.Wrapf(err1, "failed to remove buildx instance %s", name)
|
||||
}
|
||||
return err
|
||||
|
@@ -54,10 +54,7 @@ func (w remoteWorker) New(ctx context.Context, cfg *integration.BackendConfig) (
|
||||
}
|
||||
|
||||
cl = func() error {
|
||||
var err error
|
||||
if err1 := bkclose(); err == nil {
|
||||
err = err1
|
||||
}
|
||||
err := bkclose()
|
||||
cmd := exec.Command("buildx", "rm", "-f", name)
|
||||
if err1 := cmd.Run(); err == nil {
|
||||
err = err1
|
||||
|
@@ -2,16 +2,20 @@ package buildflags
|
||||
|
||||
import (
|
||||
"encoding/csv"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
controllerapi "github.com/docker/buildx/controller/pb"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const defaultPrintFunc = "build"
|
||||
|
||||
func ParsePrintFunc(str string) (*controllerapi.PrintFunc, error) {
|
||||
if str == "" {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
csvReader := csv.NewReader(strings.NewReader(str))
|
||||
fields, err := csvReader.Read()
|
||||
if err != nil {
|
||||
@@ -21,9 +25,16 @@ func ParsePrintFunc(str string) (*controllerapi.PrintFunc, error) {
|
||||
for _, field := range fields {
|
||||
parts := strings.SplitN(field, "=", 2)
|
||||
if len(parts) == 2 {
|
||||
if parts[0] == "format" {
|
||||
switch parts[0] {
|
||||
case "format":
|
||||
f.Format = parts[1]
|
||||
} else {
|
||||
case "ignorestatus":
|
||||
v, err := strconv.ParseBool(parts[1])
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "invalid ignorestatus print value: %s", parts[1])
|
||||
}
|
||||
f.IgnoreStatus = v
|
||||
default:
|
||||
return nil, errors.Errorf("invalid print field: %s", field)
|
||||
}
|
||||
} else {
|
||||
@@ -33,5 +44,17 @@ func ParsePrintFunc(str string) (*controllerapi.PrintFunc, error) {
|
||||
f.Name = field
|
||||
}
|
||||
}
|
||||
|
||||
// "check" has been added as an alias for "lint",
|
||||
// in order to maintain backwards compatibility
|
||||
// we need to convert it.
|
||||
if f.Name == "check" {
|
||||
f.Name = "lint"
|
||||
}
|
||||
|
||||
if f.Name == defaultPrintFunc {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return f, nil
|
||||
}
|
||||
|
11
util/cobrautil/boolfunc.go
Normal file
11
util/cobrautil/boolfunc.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package cobrautil
|
||||
|
||||
type BoolFuncValue func(string) error
|
||||
|
||||
func (f BoolFuncValue) Set(s string) error { return f(s) }
|
||||
|
||||
func (f BoolFuncValue) String() string { return "" }
|
||||
|
||||
func (f BoolFuncValue) Type() string { return "bool" }
|
||||
|
||||
func (f BoolFuncValue) IsBoolFlag() bool { return true }
|
@@ -4,6 +4,6 @@ import (
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func gitPath(wd string) (string, error) {
|
||||
func gitPath(_ string) (string, error) {
|
||||
return exec.LookPath("git.exe")
|
||||
}
|
||||
|
@@ -9,10 +9,10 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/containerd/containerd/content"
|
||||
"github.com/containerd/containerd/errdefs"
|
||||
"github.com/containerd/containerd/images"
|
||||
"github.com/containerd/containerd/platforms"
|
||||
"github.com/containerd/containerd/remotes"
|
||||
"github.com/containerd/errdefs"
|
||||
"github.com/distribution/reference"
|
||||
"github.com/docker/buildx/util/buildflags"
|
||||
"github.com/moby/buildkit/exporter/containerimage/exptypes"
|
||||
@@ -29,7 +29,7 @@ type Source struct {
|
||||
Ref reference.Named
|
||||
}
|
||||
|
||||
func (r *Resolver) Combine(ctx context.Context, srcs []*Source, ann []string) ([]byte, ocispec.Descriptor, error) {
|
||||
func (r *Resolver) Combine(ctx context.Context, srcs []*Source, ann []string, preferIndex bool) ([]byte, ocispec.Descriptor, error) {
|
||||
eg, ctx := errgroup.WithContext(ctx)
|
||||
|
||||
dts := make([][]byte, len(srcs))
|
||||
@@ -79,8 +79,16 @@ func (r *Resolver) Combine(ctx context.Context, srcs []*Source, ann []string) ([
|
||||
|
||||
// on single source, return original bytes
|
||||
if len(srcs) == 1 && len(ann) == 0 {
|
||||
if mt := srcs[0].Desc.MediaType; mt == images.MediaTypeDockerSchema2ManifestList || mt == ocispec.MediaTypeImageIndex {
|
||||
switch srcs[0].Desc.MediaType {
|
||||
// if the source is already an image index or manifest list, there is no need to consider the value
|
||||
// of preferIndex since if set to true then the source is already in the preferred format, and if false
|
||||
// it doesn't matter since we're not going to split it into separate manifests
|
||||
case images.MediaTypeDockerSchema2ManifestList, ocispec.MediaTypeImageIndex:
|
||||
return dts[0], srcs[0].Desc, nil
|
||||
default:
|
||||
if !preferIndex {
|
||||
return dts[0], srcs[0].Desc, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -120,14 +120,14 @@ func TestMuxIO(t *testing.T) {
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
inBuf, end, in := newTestIn(t)
|
||||
inBuf, end, in := newTestIn()
|
||||
var outBufs []*outBuf
|
||||
var outs []MuxOut
|
||||
if tt.outputsNum != len(tt.wants) {
|
||||
t.Fatalf("wants != outputsNum")
|
||||
}
|
||||
for i := 0; i < tt.outputsNum; i++ {
|
||||
outBuf, out := newTestOut(t, i)
|
||||
outBuf, out := newTestOut(i)
|
||||
outBufs = append(outBufs, outBuf)
|
||||
outs = append(outs, MuxOut{out, nil, nil})
|
||||
}
|
||||
@@ -223,7 +223,7 @@ type inBuf struct {
|
||||
doneCh chan struct{}
|
||||
}
|
||||
|
||||
func newTestIn(t *testing.T) (*inBuf, Out, In) {
|
||||
func newTestIn() (*inBuf, Out, In) {
|
||||
ti := &inBuf{
|
||||
doneCh: make(chan struct{}),
|
||||
}
|
||||
@@ -262,7 +262,7 @@ type outBuf struct {
|
||||
doneCh chan struct{}
|
||||
}
|
||||
|
||||
func newTestOut(t *testing.T, idx int) (*outBuf, Out) {
|
||||
func newTestOut(idx int) (*outBuf, Out) {
|
||||
to := &outBuf{
|
||||
idx: idx,
|
||||
doneCh: make(chan struct{}),
|
||||
@@ -285,7 +285,7 @@ func newTestOut(t *testing.T, idx int) (*outBuf, Out) {
|
||||
errW.CloseWithError(err)
|
||||
return
|
||||
}
|
||||
to.stdin = string(buf.Bytes())
|
||||
to.stdin = buf.String()
|
||||
outW.Close()
|
||||
errW.Close()
|
||||
close(to.doneCh)
|
||||
|
@@ -1,11 +1,7 @@
|
||||
package metricutil
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/docker/buildx/version"
|
||||
"github.com/docker/cli/cli/command"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/metric"
|
||||
)
|
||||
|
||||
@@ -15,10 +11,3 @@ func Meter(mp metric.MeterProvider) metric.Meter {
|
||||
return mp.Meter(version.Package,
|
||||
metric.WithInstrumentationVersion(version.Version))
|
||||
}
|
||||
|
||||
// Shutdown invokes Shutdown on the MeterProvider and then reports any error to the OTEL handler.
|
||||
func Shutdown(ctx context.Context, mp command.MeterProvider) {
|
||||
if err := mp.Shutdown(ctx); err != nil {
|
||||
otel.Handle(err)
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user