mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-19 01:47:43 +08:00
commit
7b80ad7069
@ -531,6 +531,7 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions, debugConfig *debug.D
|
|||||||
Use: "build [OPTIONS] PATH | URL | -",
|
Use: "build [OPTIONS] PATH | URL | -",
|
||||||
Short: "Start a build",
|
Short: "Start a build",
|
||||||
Args: cli.ExactArgs(1),
|
Args: cli.ExactArgs(1),
|
||||||
|
Aliases: []string{"b"},
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"aliases": "docker build, docker builder build, docker image build, docker buildx b",
|
"aliases": "docker build, docker builder build, docker image build, docker buildx b",
|
||||||
},
|
},
|
||||||
|
@ -43,6 +43,7 @@ func buildCmd(sb integration.Sandbox, opts ...cmdOpt) (string, error) {
|
|||||||
|
|
||||||
var buildTests = []func(t *testing.T, sb integration.Sandbox){
|
var buildTests = []func(t *testing.T, sb integration.Sandbox){
|
||||||
testBuild,
|
testBuild,
|
||||||
|
testBuildAlias,
|
||||||
testBuildStdin,
|
testBuildStdin,
|
||||||
testBuildRemote,
|
testBuildRemote,
|
||||||
testBuildLocalState,
|
testBuildLocalState,
|
||||||
@ -81,6 +82,13 @@ func testBuild(t *testing.T, sb integration.Sandbox) {
|
|||||||
require.NoError(t, err, string(out))
|
require.NoError(t, err, string(out))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func testBuildAlias(t *testing.T, sb integration.Sandbox) {
|
||||||
|
dir := createTestProject(t)
|
||||||
|
cmd := buildxCmd(sb, withDir(dir), withArgs("b", dir))
|
||||||
|
out, err := cmd.CombinedOutput()
|
||||||
|
require.NoError(t, err, string(out))
|
||||||
|
}
|
||||||
|
|
||||||
func testBuildStdin(t *testing.T, sb integration.Sandbox) {
|
func testBuildStdin(t *testing.T, sb integration.Sandbox) {
|
||||||
dockerfile := []byte(`
|
dockerfile := []byte(`
|
||||||
FROM busybox:latest AS base
|
FROM busybox:latest AS base
|
||||||
|
Loading…
x
Reference in New Issue
Block a user