This was deprecated in 50c4475df6304e0cf12ea95217eb00ab5d572e34, which
introduced the cli test-utils package.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -1588,7 +1588,7 @@ func (s *DockerAPISuite) TestContainersAPICreateMountsCreate(c *testing.T) {
|
| 1588 | 1588 |
var testImg string |
| 1589 | 1589 |
if testEnv.DaemonInfo.OSType != "windows" {
|
| 1590 | 1590 |
testImg = "test-mount-config" |
| 1591 |
- buildImageSuccessfully(c, testImg, build.WithDockerfile(` |
|
| 1591 |
+ cli.BuildCmd(c, testImg, build.WithDockerfile(` |
|
| 1592 | 1592 |
FROM busybox |
| 1593 | 1593 |
RUN mkdir `+destPath+` && touch `+destPath+slash+`bar |
| 1594 | 1594 |
CMD cat `+destPath+slash+`bar |
| ... | ... |
@@ -16,7 +16,7 @@ import ( |
| 16 | 16 |
|
| 17 | 17 |
func (s *DockerAPISuite) TestAPIImagesSaveAndLoad(c *testing.T) {
|
| 18 | 18 |
testRequires(c, Network) |
| 19 |
- buildImageSuccessfully(c, "saveandload", build.WithDockerfile("FROM busybox\nENV FOO bar"))
|
|
| 19 |
+ cli.BuildCmd(c, "saveandload", build.WithDockerfile("FROM busybox\nENV FOO bar"))
|
|
| 20 | 20 |
id := getIDByName(c, "saveandload") |
| 21 | 21 |
|
| 22 | 22 |
ctx := testutil.GetContext(c) |
| ... | ... |
@@ -45,7 +45,7 @@ func (s *DockerAPISuite) TestAPIImagesDelete(c *testing.T) {
|
| 45 | 45 |
testRequires(c, Network) |
| 46 | 46 |
} |
| 47 | 47 |
name := "test-api-images-delete" |
| 48 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM busybox\nENV FOO bar"))
|
|
| 48 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM busybox\nENV FOO bar"))
|
|
| 49 | 49 |
id := getIDByName(c, name) |
| 50 | 50 |
|
| 51 | 51 |
cli.DockerCmd(c, "tag", name, "test:tag1") |
| ... | ... |
@@ -61,7 +61,7 @@ func (s *DockerCLIBuildSuite) TestBuildShCmdJSONEntrypoint(c *testing.T) {
|
| 61 | 61 |
expected = "cmd /S /C echo test" |
| 62 | 62 |
} |
| 63 | 63 |
|
| 64 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 64 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 65 | 65 |
FROM busybox |
| 66 | 66 |
ENTRYPOINT ["echo"] |
| 67 | 67 |
CMD echo test |
| ... | ... |
@@ -78,7 +78,7 @@ func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementUser(c *testing.T) |
| 78 | 78 |
testRequires(c, DaemonIsLinux) |
| 79 | 79 |
const name = "testbuildenvironmentreplacement" |
| 80 | 80 |
|
| 81 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 81 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 82 | 82 |
FROM scratch |
| 83 | 83 |
ENV user foo |
| 84 | 84 |
USER ${user}
|
| ... | ... |
@@ -101,7 +101,7 @@ func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementVolume(c *testing.T |
| 101 | 101 |
volumePath = "/quux" |
| 102 | 102 |
} |
| 103 | 103 |
|
| 104 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 104 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 105 | 105 |
FROM `+minimalBaseImage()+` |
| 106 | 106 |
ENV volume `+volumePath+` |
| 107 | 107 |
VOLUME ${volume}
|
| ... | ... |
@@ -119,7 +119,7 @@ func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementExpose(c *testing.T |
| 119 | 119 |
testRequires(c, DaemonIsLinux) |
| 120 | 120 |
const name = "testbuildenvironmentreplacement" |
| 121 | 121 |
|
| 122 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 122 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 123 | 123 |
FROM scratch |
| 124 | 124 |
ENV port 80 |
| 125 | 125 |
EXPOSE ${port}
|
| ... | ... |
@@ -141,7 +141,7 @@ func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementExpose(c *testing.T |
| 141 | 141 |
func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementWorkdir(c *testing.T) {
|
| 142 | 142 |
const name = "testbuildenvironmentreplacement" |
| 143 | 143 |
|
| 144 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 144 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 145 | 145 |
FROM busybox |
| 146 | 146 |
ENV MYWORKDIR /work |
| 147 | 147 |
RUN mkdir ${MYWORKDIR}
|
| ... | ... |
@@ -161,7 +161,7 @@ func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementWorkdir(c *testing. |
| 161 | 161 |
func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementAddCopy(c *testing.T) {
|
| 162 | 162 |
const name = "testbuildenvironmentreplacement" |
| 163 | 163 |
|
| 164 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 164 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 165 | 165 |
build.WithFile("Dockerfile", `
|
| 166 | 166 |
FROM `+minimalBaseImage()+` |
| 167 | 167 |
ENV baz foo |
| ... | ... |
@@ -187,7 +187,7 @@ func (s *DockerCLIBuildSuite) TestBuildEnvironmentReplacementEnv(c *testing.T) {
|
| 187 | 187 |
testRequires(c, DaemonIsLinux) |
| 188 | 188 |
const name = "testbuildenvironmentreplacement" |
| 189 | 189 |
|
| 190 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 190 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 191 | 191 |
FROM busybox |
| 192 | 192 |
ENV foo zzz |
| 193 | 193 |
ENV bar ${foo}
|
| ... | ... |
@@ -271,7 +271,7 @@ func (s *DockerCLIBuildSuite) TestBuildHandleEscapesInVolume(c *testing.T) {
|
| 271 | 271 |
} |
| 272 | 272 |
|
| 273 | 273 |
for _, tc := range testCases {
|
| 274 |
- buildImageSuccessfully(c, name, build.WithDockerfile(fmt.Sprintf(` |
|
| 274 |
+ cli.BuildCmd(c, name, build.WithDockerfile(fmt.Sprintf(` |
|
| 275 | 275 |
FROM scratch |
| 276 | 276 |
ENV FOO bar |
| 277 | 277 |
VOLUME %s |
| ... | ... |
@@ -292,7 +292,7 @@ func (s *DockerCLIBuildSuite) TestBuildOnBuildLowercase(c *testing.T) {
|
| 292 | 292 |
const name = "testbuildonbuildlowercase" |
| 293 | 293 |
const name2 = "testbuildonbuildlowercase2" |
| 294 | 294 |
|
| 295 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 295 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 296 | 296 |
FROM busybox |
| 297 | 297 |
onbuild run echo quux |
| 298 | 298 |
`)) |
| ... | ... |
@@ -316,7 +316,7 @@ func (s *DockerCLIBuildSuite) TestBuildEnvEscapes(c *testing.T) {
|
| 316 | 316 |
// ENV expansions work differently in Windows |
| 317 | 317 |
testRequires(c, DaemonIsLinux) |
| 318 | 318 |
const name = "testbuildenvescapes" |
| 319 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 319 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 320 | 320 |
FROM busybox |
| 321 | 321 |
ENV TEST foo |
| 322 | 322 |
CMD echo \$ |
| ... | ... |
@@ -332,7 +332,7 @@ func (s *DockerCLIBuildSuite) TestBuildEnvOverwrite(c *testing.T) {
|
| 332 | 332 |
// ENV expansions work differently in Windows |
| 333 | 333 |
testRequires(c, DaemonIsLinux) |
| 334 | 334 |
const name = "testbuildenvoverwrite" |
| 335 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 335 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 336 | 336 |
FROM busybox |
| 337 | 337 |
ENV TEST foo |
| 338 | 338 |
CMD echo ${TEST}
|
| ... | ... |
@@ -366,11 +366,11 @@ func (s *DockerCLIBuildSuite) TestBuildOnBuildEntrypointJSON(c *testing.T) {
|
| 366 | 366 |
const name1 = "onbuildcmd" |
| 367 | 367 |
const name2 = "onbuildgenerated" |
| 368 | 368 |
|
| 369 |
- buildImageSuccessfully(c, name1, build.WithDockerfile(` |
|
| 369 |
+ cli.BuildCmd(c, name1, build.WithDockerfile(` |
|
| 370 | 370 |
FROM busybox |
| 371 | 371 |
ONBUILD ENTRYPOINT ["echo"]`)) |
| 372 | 372 |
|
| 373 |
- buildImageSuccessfully(c, name2, build.WithDockerfile(fmt.Sprintf("FROM %s\nCMD [\"hello world\"]\n", name1)))
|
|
| 373 |
+ cli.BuildCmd(c, name2, build.WithDockerfile(fmt.Sprintf("FROM %s\nCMD [\"hello world\"]\n", name1)))
|
|
| 374 | 374 |
|
| 375 | 375 |
out := cli.DockerCmd(c, "run", name2).Combined() |
| 376 | 376 |
if !regexp.MustCompile(`(?m)^hello world`).MatchString(out) {
|
| ... | ... |
@@ -460,12 +460,12 @@ ADD folder/file /test/changetarget`)) |
| 460 | 460 |
if err := ctx.Add("folder/file", "first"); err != nil {
|
| 461 | 461 |
c.Fatal(err) |
| 462 | 462 |
} |
| 463 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 463 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 464 | 464 |
id1 := getIDByName(c, name) |
| 465 | 465 |
if err := ctx.Add("folder/file", "second"); err != nil {
|
| 466 | 466 |
c.Fatal(err) |
| 467 | 467 |
} |
| 468 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 468 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 469 | 469 |
id2 := getIDByName(c, name) |
| 470 | 470 |
if id1 == id2 {
|
| 471 | 471 |
c.Fatal("cache was used even though file contents in folder was changed")
|
| ... | ... |
@@ -474,7 +474,7 @@ ADD folder/file /test/changetarget`)) |
| 474 | 474 |
|
| 475 | 475 |
func (s *DockerCLIBuildSuite) TestBuildAddSingleFileToRoot(c *testing.T) {
|
| 476 | 476 |
testRequires(c, DaemonIsLinux) // Linux specific test |
| 477 |
- buildImageSuccessfully(c, "testaddimg", build.WithBuildContext(c, |
|
| 477 |
+ cli.BuildCmd(c, "testaddimg", build.WithBuildContext(c, |
|
| 478 | 478 |
build.WithFile("Dockerfile", fmt.Sprintf(`FROM busybox
|
| 479 | 479 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 480 | 480 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| ... | ... |
@@ -692,7 +692,7 @@ func (s *DockerCLIBuildSuite) TestBuildCopyWildcardInName(c *testing.T) {
|
| 692 | 692 |
// say which OSs this works on or not. |
| 693 | 693 |
testRequires(c, DaemonIsLinux, UnixCli) |
| 694 | 694 |
|
| 695 |
- buildImageSuccessfully(c, "testcopywildcardinname", build.WithBuildContext(c, |
|
| 695 |
+ cli.BuildCmd(c, "testcopywildcardinname", build.WithBuildContext(c, |
|
| 696 | 696 |
build.WithFile("Dockerfile", `FROM busybox
|
| 697 | 697 |
COPY *.txt /tmp/ |
| 698 | 698 |
RUN [ "$(cat /tmp/\*.txt)" = 'hi there' ] |
| ... | ... |
@@ -710,7 +710,7 @@ func (s *DockerCLIBuildSuite) TestBuildCopyWildcardCache(c *testing.T) {
|
| 710 | 710 |
})) |
| 711 | 711 |
defer ctx.Close() |
| 712 | 712 |
|
| 713 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 713 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 714 | 714 |
id1 := getIDByName(c, name) |
| 715 | 715 |
|
| 716 | 716 |
// Now make sure we use a cache the 2nd time even with wild cards. |
| ... | ... |
@@ -718,7 +718,7 @@ func (s *DockerCLIBuildSuite) TestBuildCopyWildcardCache(c *testing.T) {
|
| 718 | 718 |
ctx.Add("Dockerfile", `FROM busybox
|
| 719 | 719 |
COPY file*.txt /tmp/`) |
| 720 | 720 |
|
| 721 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 721 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 722 | 722 |
id2 := getIDByName(c, name) |
| 723 | 723 |
|
| 724 | 724 |
if id1 != id2 {
|
| ... | ... |
@@ -728,7 +728,7 @@ func (s *DockerCLIBuildSuite) TestBuildCopyWildcardCache(c *testing.T) {
|
| 728 | 728 |
|
| 729 | 729 |
func (s *DockerCLIBuildSuite) TestBuildAddSingleFileToNonExistingDir(c *testing.T) {
|
| 730 | 730 |
testRequires(c, DaemonIsLinux) // Linux specific test |
| 731 |
- buildImageSuccessfully(c, "testaddsinglefiletononexistingdir", build.WithBuildContext(c, |
|
| 731 |
+ cli.BuildCmd(c, "testaddsinglefiletononexistingdir", build.WithBuildContext(c, |
|
| 732 | 732 |
build.WithFile("Dockerfile", `FROM busybox
|
| 733 | 733 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 734 | 734 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| ... | ... |
@@ -743,7 +743,7 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`),
|
| 743 | 743 |
|
| 744 | 744 |
func (s *DockerCLIBuildSuite) TestBuildAddDirContentToRoot(c *testing.T) {
|
| 745 | 745 |
testRequires(c, DaemonIsLinux) // Linux specific test |
| 746 |
- buildImageSuccessfully(c, "testadddircontenttoroot", build.WithBuildContext(c, |
|
| 746 |
+ cli.BuildCmd(c, "testadddircontenttoroot", build.WithBuildContext(c, |
|
| 747 | 747 |
build.WithFile("Dockerfile", `FROM busybox
|
| 748 | 748 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 749 | 749 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| ... | ... |
@@ -757,7 +757,7 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`),
|
| 757 | 757 |
|
| 758 | 758 |
func (s *DockerCLIBuildSuite) TestBuildAddDirContentToExistingDir(c *testing.T) {
|
| 759 | 759 |
testRequires(c, DaemonIsLinux) // Linux specific test |
| 760 |
- buildImageSuccessfully(c, "testadddircontenttoexistingdir", build.WithBuildContext(c, |
|
| 760 |
+ cli.BuildCmd(c, "testadddircontenttoexistingdir", build.WithBuildContext(c, |
|
| 761 | 761 |
build.WithFile("Dockerfile", `FROM busybox
|
| 762 | 762 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 763 | 763 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| ... | ... |
@@ -773,7 +773,7 @@ RUN [ $(ls -l /exists/test_file | awk '{print $3":"$4}') = 'root:root' ]`),
|
| 773 | 773 |
|
| 774 | 774 |
func (s *DockerCLIBuildSuite) TestBuildAddWholeDirToRoot(c *testing.T) {
|
| 775 | 775 |
testRequires(c, DaemonIsLinux) // Linux specific test |
| 776 |
- buildImageSuccessfully(c, "testaddwholedirtoroot", build.WithBuildContext(c, |
|
| 776 |
+ cli.BuildCmd(c, "testaddwholedirtoroot", build.WithBuildContext(c, |
|
| 777 | 777 |
build.WithFile("Dockerfile", fmt.Sprintf(`FROM busybox
|
| 778 | 778 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 779 | 779 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| ... | ... |
@@ -790,11 +790,11 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`, expecte
|
| 790 | 790 |
|
| 791 | 791 |
// Testing #5941 : Having an etc directory in context conflicts with the /etc/mtab |
| 792 | 792 |
func (s *DockerCLIBuildSuite) TestBuildAddOrCopyEtcToRootShouldNotConflict(c *testing.T) {
|
| 793 |
- buildImageSuccessfully(c, "testaddetctoroot", build.WithBuildContext(c, |
|
| 793 |
+ cli.BuildCmd(c, "testaddetctoroot", build.WithBuildContext(c, |
|
| 794 | 794 |
build.WithFile("Dockerfile", `FROM `+minimalBaseImage()+`
|
| 795 | 795 |
ADD . /`), |
| 796 | 796 |
build.WithFile("etc/test_file", "test1")))
|
| 797 |
- buildImageSuccessfully(c, "testcopyetctoroot", build.WithBuildContext(c, |
|
| 797 |
+ cli.BuildCmd(c, "testcopyetctoroot", build.WithBuildContext(c, |
|
| 798 | 798 |
build.WithFile("Dockerfile", `FROM `+minimalBaseImage()+`
|
| 799 | 799 |
COPY . /`), |
| 800 | 800 |
build.WithFile("etc/test_file", "test1")))
|
| ... | ... |
@@ -803,7 +803,7 @@ COPY . /`), |
| 803 | 803 |
// Testing #9401 : Losing setuid flag after a ADD |
| 804 | 804 |
func (s *DockerCLIBuildSuite) TestBuildAddPreservesFilesSpecialBits(c *testing.T) {
|
| 805 | 805 |
testRequires(c, DaemonIsLinux) // Linux specific test |
| 806 |
- buildImageSuccessfully(c, "testaddetctoroot", build.WithBuildContext(c, |
|
| 806 |
+ cli.BuildCmd(c, "testaddetctoroot", build.WithBuildContext(c, |
|
| 807 | 807 |
build.WithFile("Dockerfile", `FROM busybox
|
| 808 | 808 |
ADD suidbin /usr/bin/suidbin |
| 809 | 809 |
RUN chmod 4755 /usr/bin/suidbin |
| ... | ... |
@@ -816,7 +816,7 @@ RUN [ $(ls -l /usr/bin/suidbin | awk '{print $1}') = '-rwsr-xr-x' ]`),
|
| 816 | 816 |
|
| 817 | 817 |
func (s *DockerCLIBuildSuite) TestBuildCopySingleFileToRoot(c *testing.T) {
|
| 818 | 818 |
testRequires(c, DaemonIsLinux) // Linux specific test |
| 819 |
- buildImageSuccessfully(c, "testcopysinglefiletoroot", build.WithBuildContext(c, |
|
| 819 |
+ cli.BuildCmd(c, "testcopysinglefiletoroot", build.WithBuildContext(c, |
|
| 820 | 820 |
build.WithFile("Dockerfile", fmt.Sprintf(`FROM busybox
|
| 821 | 821 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 822 | 822 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| ... | ... |
@@ -854,7 +854,7 @@ COPY test_file .`), |
| 854 | 854 |
|
| 855 | 855 |
func (s *DockerCLIBuildSuite) TestBuildCopySingleFileToExistDir(c *testing.T) {
|
| 856 | 856 |
testRequires(c, DaemonIsLinux) // Linux specific test |
| 857 |
- buildImageSuccessfully(c, "testcopysinglefiletoexistdir", build.WithBuildContext(c, |
|
| 857 |
+ cli.BuildCmd(c, "testcopysinglefiletoexistdir", build.WithBuildContext(c, |
|
| 858 | 858 |
build.WithFile("Dockerfile", `FROM busybox
|
| 859 | 859 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 860 | 860 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| ... | ... |
@@ -870,7 +870,7 @@ RUN [ $(ls -l /exists/exists_file | awk '{print $3":"$4}') = 'dockerio:dockerio'
|
| 870 | 870 |
|
| 871 | 871 |
func (s *DockerCLIBuildSuite) TestBuildCopySingleFileToNonExistDir(c *testing.T) {
|
| 872 | 872 |
testRequires(c, DaemonIsLinux) // Linux specific |
| 873 |
- buildImageSuccessfully(c, "testcopysinglefiletononexistdir", build.WithBuildContext(c, |
|
| 873 |
+ cli.BuildCmd(c, "testcopysinglefiletononexistdir", build.WithBuildContext(c, |
|
| 874 | 874 |
build.WithFile("Dockerfile", `FROM busybox
|
| 875 | 875 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 876 | 876 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| ... | ... |
@@ -885,7 +885,7 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`),
|
| 885 | 885 |
|
| 886 | 886 |
func (s *DockerCLIBuildSuite) TestBuildCopyDirContentToRoot(c *testing.T) {
|
| 887 | 887 |
testRequires(c, DaemonIsLinux) // Linux specific test |
| 888 |
- buildImageSuccessfully(c, "testcopydircontenttoroot", build.WithBuildContext(c, |
|
| 888 |
+ cli.BuildCmd(c, "testcopydircontenttoroot", build.WithBuildContext(c, |
|
| 889 | 889 |
build.WithFile("Dockerfile", `FROM busybox
|
| 890 | 890 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 891 | 891 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| ... | ... |
@@ -899,7 +899,7 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`),
|
| 899 | 899 |
|
| 900 | 900 |
func (s *DockerCLIBuildSuite) TestBuildCopyDirContentToExistDir(c *testing.T) {
|
| 901 | 901 |
testRequires(c, DaemonIsLinux) // Linux specific test |
| 902 |
- buildImageSuccessfully(c, "testcopydircontenttoexistdir", build.WithBuildContext(c, |
|
| 902 |
+ cli.BuildCmd(c, "testcopydircontenttoexistdir", build.WithBuildContext(c, |
|
| 903 | 903 |
build.WithFile("Dockerfile", `FROM busybox
|
| 904 | 904 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 905 | 905 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| ... | ... |
@@ -915,7 +915,7 @@ RUN [ $(ls -l /exists/test_file | awk '{print $3":"$4}') = 'root:root' ]`),
|
| 915 | 915 |
|
| 916 | 916 |
func (s *DockerCLIBuildSuite) TestBuildCopyWholeDirToRoot(c *testing.T) {
|
| 917 | 917 |
testRequires(c, DaemonIsLinux) // Linux specific test |
| 918 |
- buildImageSuccessfully(c, "testcopywholedirtoroot", build.WithBuildContext(c, |
|
| 918 |
+ cli.BuildCmd(c, "testcopywholedirtoroot", build.WithBuildContext(c, |
|
| 919 | 919 |
build.WithFile("Dockerfile", fmt.Sprintf(`FROM busybox
|
| 920 | 920 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 921 | 921 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| ... | ... |
@@ -995,7 +995,7 @@ func (s *DockerCLIBuildSuite) TestBuildAddBadLinks(c *testing.T) {
|
| 995 | 995 |
c.Fatal(err) |
| 996 | 996 |
} |
| 997 | 997 |
|
| 998 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 998 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 999 | 999 |
if _, err := os.Stat(nonExistingFile); err == nil || !os.IsNotExist(err) {
|
| 1000 | 1000 |
c.Fatalf("%s shouldn't have been written and it shouldn't exist", nonExistingFile)
|
| 1001 | 1001 |
} |
| ... | ... |
@@ -1030,7 +1030,7 @@ func (s *DockerCLIBuildSuite) TestBuildAddBadLinksVolume(c *testing.T) {
|
| 1030 | 1030 |
c.Fatal(err) |
| 1031 | 1031 |
} |
| 1032 | 1032 |
|
| 1033 |
- buildImageSuccessfully(c, "test-link-absolute-volume", build.WithExternalBuildContext(ctx)) |
|
| 1033 |
+ cli.BuildCmd(c, "test-link-absolute-volume", build.WithExternalBuildContext(ctx)) |
|
| 1034 | 1034 |
if _, err := os.Stat(nonExistingFile); err == nil || !os.IsNotExist(err) {
|
| 1035 | 1035 |
c.Fatalf("%s shouldn't have been written and it shouldn't exist", nonExistingFile)
|
| 1036 | 1036 |
} |
| ... | ... |
@@ -1124,7 +1124,7 @@ func (s *DockerCLIBuildSuite) TestBuildWithInaccessibleFilesInContext(c *testing |
| 1124 | 1124 |
defer os.Remove(target) |
| 1125 | 1125 |
// This is used to ensure we don't follow links when checking if everything in the context is accessible |
| 1126 | 1126 |
// This test doesn't require that we run commands as an unprivileged user |
| 1127 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 1127 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 1128 | 1128 |
} |
| 1129 | 1129 |
{
|
| 1130 | 1130 |
const name = "testbuildignoredinaccessible" |
| ... | ... |
@@ -1203,7 +1203,7 @@ func (s *DockerCLIBuildSuite) TestBuildRm(c *testing.T) {
|
| 1203 | 1203 |
for _, tc := range testCases {
|
| 1204 | 1204 |
containerCountBefore := getContainerCount(c) |
| 1205 | 1205 |
|
| 1206 |
- buildImageSuccessfully(c, name, cli.WithFlags(tc.buildflags...), build.WithDockerfile(`FROM busybox |
|
| 1206 |
+ cli.BuildCmd(c, name, cli.WithFlags(tc.buildflags...), build.WithDockerfile(`FROM busybox |
|
| 1207 | 1207 |
RUN echo hello world`)) |
| 1208 | 1208 |
|
| 1209 | 1209 |
containerCountAfter := getContainerCount(c) |
| ... | ... |
@@ -1239,7 +1239,7 @@ func (s *DockerCLIBuildSuite) TestBuildWithVolumes(c *testing.T) {
|
| 1239 | 1239 |
} |
| 1240 | 1240 |
) |
| 1241 | 1241 |
|
| 1242 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM scratch |
|
| 1242 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM scratch |
|
| 1243 | 1243 |
VOLUME /test1 |
| 1244 | 1244 |
VOLUME /test2 |
| 1245 | 1245 |
VOLUME /test3 /test4 |
| ... | ... |
@@ -1258,7 +1258,7 @@ func (s *DockerCLIBuildSuite) TestBuildWithVolumes(c *testing.T) {
|
| 1258 | 1258 |
func (s *DockerCLIBuildSuite) TestBuildMaintainer(c *testing.T) {
|
| 1259 | 1259 |
const name = "testbuildmaintainer" |
| 1260 | 1260 |
|
| 1261 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 1261 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 1262 | 1262 |
MAINTAINER dockerio`)) |
| 1263 | 1263 |
|
| 1264 | 1264 |
expected := "dockerio" |
| ... | ... |
@@ -1272,7 +1272,7 @@ func (s *DockerCLIBuildSuite) TestBuildUser(c *testing.T) {
|
| 1272 | 1272 |
testRequires(c, DaemonIsLinux) |
| 1273 | 1273 |
const name = "testbuilduser" |
| 1274 | 1274 |
expected := "dockerio" |
| 1275 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 1275 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 1276 | 1276 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 1277 | 1277 |
USER dockerio |
| 1278 | 1278 |
RUN [ $(whoami) = 'dockerio' ]`)) |
| ... | ... |
@@ -1307,7 +1307,7 @@ func (s *DockerCLIBuildSuite) TestBuildRelativeWorkdir(c *testing.T) {
|
| 1307 | 1307 |
expectedFinal = `/test2/test3` |
| 1308 | 1308 |
} |
| 1309 | 1309 |
|
| 1310 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 1310 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 1311 | 1311 |
RUN sh -c "[ "$PWD" = "`+expected1+`" ]" |
| 1312 | 1312 |
WORKDIR test1 |
| 1313 | 1313 |
RUN sh -c "[ "$PWD" = "`+expected2+`" ]" |
| ... | ... |
@@ -1326,7 +1326,7 @@ func (s *DockerCLIBuildSuite) TestBuildRelativeWorkdir(c *testing.T) {
|
| 1326 | 1326 |
// Windows semantics. Most path handling verifications are in unit tests |
| 1327 | 1327 |
func (s *DockerCLIBuildSuite) TestBuildWindowsWorkdirProcessing(c *testing.T) {
|
| 1328 | 1328 |
testRequires(c, DaemonIsWindows) |
| 1329 |
- buildImageSuccessfully(c, "testbuildwindowsworkdirprocessing", build.WithDockerfile(`FROM busybox |
|
| 1329 |
+ cli.BuildCmd(c, "testbuildwindowsworkdirprocessing", build.WithDockerfile(`FROM busybox |
|
| 1330 | 1330 |
WORKDIR C:\\foo |
| 1331 | 1331 |
WORKDIR bar |
| 1332 | 1332 |
RUN sh -c "[ "$PWD" = "C:/foo/bar" ]" |
| ... | ... |
@@ -1341,7 +1341,7 @@ func (s *DockerCLIBuildSuite) TestBuildWindowsAddCopyPathProcessing(c *testing.T |
| 1341 | 1341 |
// support backslash such as .\\ being equivalent to ./ and c:\\ being |
| 1342 | 1342 |
// equivalent to c:/. This is not currently (nor ever has been) supported |
| 1343 | 1343 |
// by docker on the Windows platform. |
| 1344 |
- buildImageSuccessfully(c, "testbuildwindowsaddcopypathprocessing", build.WithBuildContext(c, |
|
| 1344 |
+ cli.BuildCmd(c, "testbuildwindowsaddcopypathprocessing", build.WithBuildContext(c, |
|
| 1345 | 1345 |
build.WithFile("Dockerfile", `FROM busybox
|
| 1346 | 1346 |
# No trailing slash on COPY/ADD |
| 1347 | 1347 |
# Results in dir being changed to a file |
| ... | ... |
@@ -1378,7 +1378,7 @@ func (s *DockerCLIBuildSuite) TestBuildWorkdirWithEnvVariables(c *testing.T) {
|
| 1378 | 1378 |
expected = `/test1/test2` |
| 1379 | 1379 |
} |
| 1380 | 1380 |
|
| 1381 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 1381 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 1382 | 1382 |
ENV DIRPATH /test1 |
| 1383 | 1383 |
ENV SUBDIRNAME test2 |
| 1384 | 1384 |
WORKDIR $DIRPATH |
| ... | ... |
@@ -1400,7 +1400,7 @@ func (s *DockerCLIBuildSuite) TestBuildRelativeCopy(c *testing.T) {
|
| 1400 | 1400 |
expected = `/test1/test2` |
| 1401 | 1401 |
} |
| 1402 | 1402 |
|
| 1403 |
- buildImageSuccessfully(c, "testbuildrelativecopy", build.WithBuildContext(c, |
|
| 1403 |
+ cli.BuildCmd(c, "testbuildrelativecopy", build.WithBuildContext(c, |
|
| 1404 | 1404 |
build.WithFile("Dockerfile", `FROM busybox
|
| 1405 | 1405 |
WORKDIR /test1 |
| 1406 | 1406 |
WORKDIR test2 |
| ... | ... |
@@ -1461,7 +1461,7 @@ func (s *DockerCLIBuildSuite) TestBuildEnv(c *testing.T) {
|
| 1461 | 1461 |
testRequires(c, DaemonIsLinux) // ENV expansion is different in Windows |
| 1462 | 1462 |
const name = "testbuildenv" |
| 1463 | 1463 |
expected := "[PATH=/test:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PORT=2375]" |
| 1464 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 1464 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 1465 | 1465 |
ENV PATH /test:$PATH |
| 1466 | 1466 |
ENV PORT 2375 |
| 1467 | 1467 |
RUN [ $(env | grep PORT) = 'PORT=2375' ]`)) |
| ... | ... |
@@ -1477,7 +1477,7 @@ func (s *DockerCLIBuildSuite) TestBuildPATH(c *testing.T) {
|
| 1477 | 1477 |
defPath := "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
| 1478 | 1478 |
|
| 1479 | 1479 |
fn := func(dockerfile string, expected string) {
|
| 1480 |
- buildImageSuccessfully(c, "testbldpath", build.WithDockerfile(dockerfile)) |
|
| 1480 |
+ cli.BuildCmd(c, "testbldpath", build.WithDockerfile(dockerfile)) |
|
| 1481 | 1481 |
res := inspectField(c, "testbldpath", "Config.Env") |
| 1482 | 1482 |
if res != expected {
|
| 1483 | 1483 |
c.Fatalf("Env %q, expected %q for dockerfile:%q", res, expected, dockerfile)
|
| ... | ... |
@@ -1509,7 +1509,7 @@ func (s *DockerCLIBuildSuite) TestBuildContextCleanup(c *testing.T) {
|
| 1509 | 1509 |
c.Fatalf("failed to list contents of tmp dir: %s", err)
|
| 1510 | 1510 |
} |
| 1511 | 1511 |
|
| 1512 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 1512 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 1513 | 1513 |
ENTRYPOINT ["/bin/echo"]`)) |
| 1514 | 1514 |
|
| 1515 | 1515 |
entriesFinal, err := os.ReadDir(filepath.Join(testEnv.DaemonInfo.DockerRootDir, "tmp")) |
| ... | ... |
@@ -1567,7 +1567,7 @@ func (s *DockerCLIBuildSuite) TestBuildCmd(c *testing.T) {
|
| 1567 | 1567 |
const name = "testbuildcmd" |
| 1568 | 1568 |
expected := "[/bin/echo Hello World]" |
| 1569 | 1569 |
|
| 1570 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 1570 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 1571 | 1571 |
CMD ["/bin/echo", "Hello World"]`)) |
| 1572 | 1572 |
|
| 1573 | 1573 |
res := inspectField(c, name, "Config.Cmd") |
| ... | ... |
@@ -1581,7 +1581,7 @@ func (s *DockerCLIBuildSuite) TestBuildExpose(c *testing.T) {
|
| 1581 | 1581 |
const name = "testbuildexpose" |
| 1582 | 1582 |
expected := "map[2375/tcp:{}]"
|
| 1583 | 1583 |
|
| 1584 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM scratch |
|
| 1584 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM scratch |
|
| 1585 | 1585 |
EXPOSE 2375`)) |
| 1586 | 1586 |
|
| 1587 | 1587 |
res := inspectField(c, name, "Config.ExposedPorts") |
| ... | ... |
@@ -1617,7 +1617,7 @@ func (s *DockerCLIBuildSuite) TestBuildExposeMorePorts(c *testing.T) {
|
| 1617 | 1617 |
tmpl.Execute(buf, portList) |
| 1618 | 1618 |
|
| 1619 | 1619 |
const name = "testbuildexpose" |
| 1620 |
- buildImageSuccessfully(c, name, build.WithDockerfile(buf.String())) |
|
| 1620 |
+ cli.BuildCmd(c, name, build.WithDockerfile(buf.String())) |
|
| 1621 | 1621 |
|
| 1622 | 1622 |
// check if all the ports are saved inside Config.ExposedPorts |
| 1623 | 1623 |
res := inspectFieldJSON(c, name, "Config.ExposedPorts") |
| ... | ... |
@@ -1642,7 +1642,7 @@ func (s *DockerCLIBuildSuite) TestBuildExposeMorePorts(c *testing.T) {
|
| 1642 | 1642 |
func (s *DockerCLIBuildSuite) TestBuildExposeOrder(c *testing.T) {
|
| 1643 | 1643 |
testRequires(c, DaemonIsLinux) // Expose not implemented on Windows |
| 1644 | 1644 |
buildID := func(name, exposed string) string {
|
| 1645 |
- buildImageSuccessfully(c, name, build.WithDockerfile(fmt.Sprintf(`FROM scratch |
|
| 1645 |
+ cli.BuildCmd(c, name, build.WithDockerfile(fmt.Sprintf(`FROM scratch |
|
| 1646 | 1646 |
EXPOSE %s`, exposed))) |
| 1647 | 1647 |
id := inspectField(c, name, "Id") |
| 1648 | 1648 |
return id |
| ... | ... |
@@ -1659,7 +1659,7 @@ func (s *DockerCLIBuildSuite) TestBuildExposeUpperCaseProto(c *testing.T) {
|
| 1659 | 1659 |
testRequires(c, DaemonIsLinux) // Expose not implemented on Windows |
| 1660 | 1660 |
const name = "testbuildexposeuppercaseproto" |
| 1661 | 1661 |
expected := "map[5678/udp:{}]"
|
| 1662 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM scratch |
|
| 1662 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM scratch |
|
| 1663 | 1663 |
EXPOSE 5678/UDP`)) |
| 1664 | 1664 |
res := inspectField(c, name, "Config.ExposedPorts") |
| 1665 | 1665 |
if res != expected {
|
| ... | ... |
@@ -1671,7 +1671,7 @@ func (s *DockerCLIBuildSuite) TestBuildEmptyEntrypointInheritance(c *testing.T) |
| 1671 | 1671 |
const name = "testbuildentrypointinheritance" |
| 1672 | 1672 |
const name2 = "testbuildentrypointinheritance2" |
| 1673 | 1673 |
|
| 1674 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 1674 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 1675 | 1675 |
ENTRYPOINT ["/bin/echo"]`)) |
| 1676 | 1676 |
res := inspectField(c, name, "Config.Entrypoint") |
| 1677 | 1677 |
|
| ... | ... |
@@ -1680,7 +1680,7 @@ func (s *DockerCLIBuildSuite) TestBuildEmptyEntrypointInheritance(c *testing.T) |
| 1680 | 1680 |
c.Fatalf("Entrypoint %s, expected %s", res, expected)
|
| 1681 | 1681 |
} |
| 1682 | 1682 |
|
| 1683 |
- buildImageSuccessfully(c, name2, build.WithDockerfile(fmt.Sprintf(`FROM %s |
|
| 1683 |
+ cli.BuildCmd(c, name2, build.WithDockerfile(fmt.Sprintf(`FROM %s |
|
| 1684 | 1684 |
ENTRYPOINT []`, name))) |
| 1685 | 1685 |
res = inspectField(c, name2, "Config.Entrypoint") |
| 1686 | 1686 |
|
| ... | ... |
@@ -1694,7 +1694,7 @@ func (s *DockerCLIBuildSuite) TestBuildEmptyEntrypoint(c *testing.T) {
|
| 1694 | 1694 |
const name = "testbuildentrypoint" |
| 1695 | 1695 |
expected := "[]" |
| 1696 | 1696 |
|
| 1697 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 1697 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 1698 | 1698 |
ENTRYPOINT []`)) |
| 1699 | 1699 |
|
| 1700 | 1700 |
res := inspectField(c, name, "Config.Entrypoint") |
| ... | ... |
@@ -1707,7 +1707,7 @@ func (s *DockerCLIBuildSuite) TestBuildEntrypoint(c *testing.T) {
|
| 1707 | 1707 |
const name = "testbuildentrypoint" |
| 1708 | 1708 |
|
| 1709 | 1709 |
expected := "[/bin/echo]" |
| 1710 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 1710 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 1711 | 1711 |
ENTRYPOINT ["/bin/echo"]`)) |
| 1712 | 1712 |
|
| 1713 | 1713 |
res := inspectField(c, name, "Config.Entrypoint") |
| ... | ... |
@@ -1718,7 +1718,7 @@ func (s *DockerCLIBuildSuite) TestBuildEntrypoint(c *testing.T) {
|
| 1718 | 1718 |
|
| 1719 | 1719 |
// #6445 ensure ONBUILD triggers aren't committed to grandchildren |
| 1720 | 1720 |
func (s *DockerCLIBuildSuite) TestBuildOnBuildLimitedInheritance(c *testing.T) {
|
| 1721 |
- buildImageSuccessfully(c, "testonbuildtrigger1", build.WithDockerfile(` |
|
| 1721 |
+ cli.BuildCmd(c, "testonbuildtrigger1", build.WithDockerfile(` |
|
| 1722 | 1722 |
FROM busybox |
| 1723 | 1723 |
RUN echo "GRANDPARENT" |
| 1724 | 1724 |
ONBUILD RUN echo "ONBUILD PARENT" |
| ... | ... |
@@ -1742,11 +1742,11 @@ func (s *DockerCLIBuildSuite) TestBuildSameDockerfileWithAndWithoutCache(c *test |
| 1742 | 1742 |
MAINTAINER dockerio |
| 1743 | 1743 |
EXPOSE 5432 |
| 1744 | 1744 |
ENTRYPOINT ["/bin/echo"]` |
| 1745 |
- buildImageSuccessfully(c, name, build.WithDockerfile(dockerfile)) |
|
| 1745 |
+ cli.BuildCmd(c, name, build.WithDockerfile(dockerfile)) |
|
| 1746 | 1746 |
id1 := getIDByName(c, name) |
| 1747 |
- buildImageSuccessfully(c, name, build.WithDockerfile(dockerfile)) |
|
| 1747 |
+ cli.BuildCmd(c, name, build.WithDockerfile(dockerfile)) |
|
| 1748 | 1748 |
id2 := getIDByName(c, name) |
| 1749 |
- buildImageSuccessfully(c, name, build.WithoutCache, build.WithDockerfile(dockerfile)) |
|
| 1749 |
+ cli.BuildCmd(c, name, build.WithoutCache, build.WithDockerfile(dockerfile)) |
|
| 1750 | 1750 |
id3 := getIDByName(c, name) |
| 1751 | 1751 |
if id1 != id2 {
|
| 1752 | 1752 |
c.Fatal("The cache should have been used but hasn't.")
|
| ... | ... |
@@ -1860,13 +1860,13 @@ func (s *DockerCLIBuildSuite) TestBuildAddCurrentDirWithCache(c *testing.T) {
|
| 1860 | 1860 |
"foo": "hello", |
| 1861 | 1861 |
})) |
| 1862 | 1862 |
defer ctx.Close() |
| 1863 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 1863 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 1864 | 1864 |
id1 := getIDByName(c, name) |
| 1865 | 1865 |
// Check that adding file invalidate cache of "ADD ." |
| 1866 | 1866 |
if err := ctx.Add("bar", "hello2"); err != nil {
|
| 1867 | 1867 |
c.Fatal(err) |
| 1868 | 1868 |
} |
| 1869 |
- buildImageSuccessfully(c, name2, build.WithExternalBuildContext(ctx)) |
|
| 1869 |
+ cli.BuildCmd(c, name2, build.WithExternalBuildContext(ctx)) |
|
| 1870 | 1870 |
id2 := getIDByName(c, name2) |
| 1871 | 1871 |
if id1 == id2 {
|
| 1872 | 1872 |
c.Fatal("The cache should have been invalided but hasn't.")
|
| ... | ... |
@@ -1875,7 +1875,7 @@ func (s *DockerCLIBuildSuite) TestBuildAddCurrentDirWithCache(c *testing.T) {
|
| 1875 | 1875 |
if err := ctx.Add("foo", "hello1"); err != nil {
|
| 1876 | 1876 |
c.Fatal(err) |
| 1877 | 1877 |
} |
| 1878 |
- buildImageSuccessfully(c, name3, build.WithExternalBuildContext(ctx)) |
|
| 1878 |
+ cli.BuildCmd(c, name3, build.WithExternalBuildContext(ctx)) |
|
| 1879 | 1879 |
id3 := getIDByName(c, name3) |
| 1880 | 1880 |
if id2 == id3 {
|
| 1881 | 1881 |
c.Fatal("The cache should have been invalided but hasn't.")
|
| ... | ... |
@@ -1886,7 +1886,7 @@ func (s *DockerCLIBuildSuite) TestBuildAddCurrentDirWithCache(c *testing.T) {
|
| 1886 | 1886 |
if err := ctx.Add("foo", "hello1"); err != nil {
|
| 1887 | 1887 |
c.Fatal(err) |
| 1888 | 1888 |
} |
| 1889 |
- buildImageSuccessfully(c, name4, build.WithExternalBuildContext(ctx)) |
|
| 1889 |
+ cli.BuildCmd(c, name4, build.WithExternalBuildContext(ctx)) |
|
| 1890 | 1890 |
id4 := getIDByName(c, name4) |
| 1891 | 1891 |
if id3 != id4 {
|
| 1892 | 1892 |
c.Fatal("The cache should have been used but hasn't.")
|
| ... | ... |
@@ -1904,9 +1904,9 @@ func (s *DockerCLIBuildSuite) TestBuildAddCurrentDirWithoutCache(c *testing.T) {
|
| 1904 | 1904 |
"foo": "hello", |
| 1905 | 1905 |
})) |
| 1906 | 1906 |
defer ctx.Close() |
| 1907 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 1907 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 1908 | 1908 |
id1 := getIDByName(c, name) |
| 1909 |
- buildImageSuccessfully(c, name, build.WithoutCache, build.WithExternalBuildContext(ctx)) |
|
| 1909 |
+ cli.BuildCmd(c, name, build.WithoutCache, build.WithExternalBuildContext(ctx)) |
|
| 1910 | 1910 |
id2 := getIDByName(c, name) |
| 1911 | 1911 |
if id1 == id2 {
|
| 1912 | 1912 |
c.Fatal("The cache should have been invalided but hasn't.")
|
| ... | ... |
@@ -1996,11 +1996,11 @@ func (s *DockerCLIBuildSuite) TestBuildAddLocalAndRemoteFilesWithAndWithoutCache |
| 1996 | 1996 |
"foo": "hello world", |
| 1997 | 1997 |
})) |
| 1998 | 1998 |
defer ctx.Close() |
| 1999 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 1999 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 2000 | 2000 |
id1 := getIDByName(c, name) |
| 2001 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 2001 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 2002 | 2002 |
id2 := getIDByName(c, name) |
| 2003 |
- buildImageSuccessfully(c, name, build.WithoutCache, build.WithExternalBuildContext(ctx)) |
|
| 2003 |
+ cli.BuildCmd(c, name, build.WithoutCache, build.WithExternalBuildContext(ctx)) |
|
| 2004 | 2004 |
id3 := getIDByName(c, name) |
| 2005 | 2005 |
if id1 != id2 {
|
| 2006 | 2006 |
c.Fatal("The cache should have been used but hasn't.")
|
| ... | ... |
@@ -2138,7 +2138,7 @@ func (s *DockerCLIBuildSuite) TestBuildWithVolumeOwnership(c *testing.T) {
|
| 2138 | 2138 |
testRequires(c, DaemonIsLinux) |
| 2139 | 2139 |
const name = "testbuildimg" |
| 2140 | 2140 |
|
| 2141 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox:latest |
|
| 2141 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox:latest |
|
| 2142 | 2142 |
RUN mkdir /test && chown daemon:wheel /test && chmod 0600 /test |
| 2143 | 2143 |
VOLUME /test`)) |
| 2144 | 2144 |
|
| ... | ... |
@@ -2155,10 +2155,10 @@ func (s *DockerCLIBuildSuite) TestBuildWithVolumeOwnership(c *testing.T) {
|
| 2155 | 2155 |
// utilizing cache |
| 2156 | 2156 |
func (s *DockerCLIBuildSuite) TestBuildEntrypointRunCleanup(c *testing.T) {
|
| 2157 | 2157 |
const name = "testbuildcmdcleanup" |
| 2158 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 2158 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 2159 | 2159 |
RUN echo "hello"`)) |
| 2160 | 2160 |
|
| 2161 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2161 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2162 | 2162 |
build.WithFile("Dockerfile", `FROM busybox
|
| 2163 | 2163 |
RUN echo "hello" |
| 2164 | 2164 |
ADD foo /foo |
| ... | ... |
@@ -2188,11 +2188,11 @@ func (s *DockerCLIBuildSuite) TestBuildInheritance(c *testing.T) {
|
| 2188 | 2188 |
testRequires(c, DaemonIsLinux) |
| 2189 | 2189 |
const name = "testbuildinheritance" |
| 2190 | 2190 |
|
| 2191 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM scratch |
|
| 2191 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM scratch |
|
| 2192 | 2192 |
EXPOSE 2375`)) |
| 2193 | 2193 |
ports1 := inspectField(c, name, "Config.ExposedPorts") |
| 2194 | 2194 |
|
| 2195 |
- buildImageSuccessfully(c, name, build.WithDockerfile(fmt.Sprintf(`FROM %s |
|
| 2195 |
+ cli.BuildCmd(c, name, build.WithDockerfile(fmt.Sprintf(`FROM %s |
|
| 2196 | 2196 |
ENTRYPOINT ["/bin/echo"]`, name))) |
| 2197 | 2197 |
|
| 2198 | 2198 |
res := inspectField(c, name, "Config.Entrypoint") |
| ... | ... |
@@ -2216,9 +2216,9 @@ func (s *DockerCLIBuildSuite) TestBuildFails(c *testing.T) {
|
| 2216 | 2216 |
|
| 2217 | 2217 |
func (s *DockerCLIBuildSuite) TestBuildOnBuild(c *testing.T) {
|
| 2218 | 2218 |
const name = "testbuildonbuild" |
| 2219 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 2219 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 2220 | 2220 |
ONBUILD RUN touch foobar`)) |
| 2221 |
- buildImageSuccessfully(c, name, build.WithDockerfile(fmt.Sprintf(`FROM %s |
|
| 2221 |
+ cli.BuildCmd(c, name, build.WithDockerfile(fmt.Sprintf(`FROM %s |
|
| 2222 | 2222 |
RUN [ -f foobar ]`, name))) |
| 2223 | 2223 |
} |
| 2224 | 2224 |
|
| ... | ... |
@@ -2229,7 +2229,7 @@ func (s *DockerCLIBuildSuite) TestBuildAddToSymlinkDest(c *testing.T) {
|
| 2229 | 2229 |
makeLink = `mklink /D C:\bar C:\foo` |
| 2230 | 2230 |
} |
| 2231 | 2231 |
const name = "testbuildaddtosymlinkdest" |
| 2232 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2232 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2233 | 2233 |
build.WithFile("Dockerfile", `
|
| 2234 | 2234 |
FROM busybox |
| 2235 | 2235 |
RUN sh -c "mkdir /foo" |
| ... | ... |
@@ -2244,7 +2244,7 @@ func (s *DockerCLIBuildSuite) TestBuildAddToSymlinkDest(c *testing.T) {
|
| 2244 | 2244 |
func (s *DockerCLIBuildSuite) TestBuildEscapeWhitespace(c *testing.T) {
|
| 2245 | 2245 |
const name = "testbuildescapewhitespace" |
| 2246 | 2246 |
|
| 2247 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 2247 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 2248 | 2248 |
# ESCAPE=\ |
| 2249 | 2249 |
FROM busybox |
| 2250 | 2250 |
MAINTAINER "Docker \ |
| ... | ... |
@@ -2262,7 +2262,7 @@ func (s *DockerCLIBuildSuite) TestBuildVerifyIntString(c *testing.T) {
|
| 2262 | 2262 |
// Verify that strings that look like ints are still passed as strings |
| 2263 | 2263 |
const name = "testbuildstringing" |
| 2264 | 2264 |
|
| 2265 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 2265 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 2266 | 2266 |
FROM busybox |
| 2267 | 2267 |
MAINTAINER 123`)) |
| 2268 | 2268 |
|
| ... | ... |
@@ -2274,7 +2274,7 @@ func (s *DockerCLIBuildSuite) TestBuildVerifyIntString(c *testing.T) {
|
| 2274 | 2274 |
|
| 2275 | 2275 |
func (s *DockerCLIBuildSuite) TestBuildDockerignore(c *testing.T) {
|
| 2276 | 2276 |
const name = "testbuilddockerignore" |
| 2277 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2277 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2278 | 2278 |
build.WithFile("Dockerfile", `
|
| 2279 | 2279 |
FROM busybox |
| 2280 | 2280 |
ADD . /bla |
| ... | ... |
@@ -2312,7 +2312,7 @@ dir`), |
| 2312 | 2312 |
|
| 2313 | 2313 |
func (s *DockerCLIBuildSuite) TestBuildDockerignoreCleanPaths(c *testing.T) {
|
| 2314 | 2314 |
const name = "testbuilddockerignorecleanpaths" |
| 2315 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2315 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2316 | 2316 |
build.WithFile("Dockerfile", `
|
| 2317 | 2317 |
FROM busybox |
| 2318 | 2318 |
ADD . /tmp/ |
| ... | ... |
@@ -2326,7 +2326,7 @@ func (s *DockerCLIBuildSuite) TestBuildDockerignoreCleanPaths(c *testing.T) {
|
| 2326 | 2326 |
|
| 2327 | 2327 |
func (s *DockerCLIBuildSuite) TestBuildDockerignoreExceptions(c *testing.T) {
|
| 2328 | 2328 |
const name = "testbuilddockerignoreexceptions" |
| 2329 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2329 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2330 | 2330 |
build.WithFile("Dockerfile", `
|
| 2331 | 2331 |
FROM busybox |
| 2332 | 2332 |
ADD . /bla |
| ... | ... |
@@ -2376,12 +2376,12 @@ func (s *DockerCLIBuildSuite) TestBuildDockerignoringDockerfile(c *testing.T) {
|
| 2376 | 2376 |
ADD . /tmp/ |
| 2377 | 2377 |
RUN sh -c "! ls /tmp/Dockerfile" |
| 2378 | 2378 |
RUN ls /tmp/.dockerignore` |
| 2379 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2379 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2380 | 2380 |
build.WithFile("Dockerfile", dockerfile),
|
| 2381 | 2381 |
build.WithFile(".dockerignore", "Dockerfile\n"),
|
| 2382 | 2382 |
)) |
| 2383 | 2383 |
// FIXME(vdemeester) why twice ? |
| 2384 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2384 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2385 | 2385 |
build.WithFile("Dockerfile", dockerfile),
|
| 2386 | 2386 |
build.WithFile(".dockerignore", "./Dockerfile\n"),
|
| 2387 | 2387 |
)) |
| ... | ... |
@@ -2395,13 +2395,13 @@ func (s *DockerCLIBuildSuite) TestBuildDockerignoringRenamedDockerfile(c *testin |
| 2395 | 2395 |
RUN ls /tmp/Dockerfile |
| 2396 | 2396 |
RUN sh -c "! ls /tmp/MyDockerfile" |
| 2397 | 2397 |
RUN ls /tmp/.dockerignore` |
| 2398 |
- buildImageSuccessfully(c, name, cli.WithFlags("-f", "MyDockerfile"), build.WithBuildContext(c,
|
|
| 2398 |
+ cli.BuildCmd(c, name, cli.WithFlags("-f", "MyDockerfile"), build.WithBuildContext(c,
|
|
| 2399 | 2399 |
build.WithFile("Dockerfile", "Should not use me"),
|
| 2400 | 2400 |
build.WithFile("MyDockerfile", dockerfile),
|
| 2401 | 2401 |
build.WithFile(".dockerignore", "MyDockerfile\n"),
|
| 2402 | 2402 |
)) |
| 2403 | 2403 |
// FIXME(vdemeester) why twice ? |
| 2404 |
- buildImageSuccessfully(c, name, cli.WithFlags("-f", "MyDockerfile"), build.WithBuildContext(c,
|
|
| 2404 |
+ cli.BuildCmd(c, name, cli.WithFlags("-f", "MyDockerfile"), build.WithBuildContext(c,
|
|
| 2405 | 2405 |
build.WithFile("Dockerfile", "Should not use me"),
|
| 2406 | 2406 |
build.WithFile("MyDockerfile", dockerfile),
|
| 2407 | 2407 |
build.WithFile(".dockerignore", "./MyDockerfile\n"),
|
| ... | ... |
@@ -2415,7 +2415,7 @@ func (s *DockerCLIBuildSuite) TestBuildDockerignoringDockerignore(c *testing.T) |
| 2415 | 2415 |
ADD . /tmp/ |
| 2416 | 2416 |
RUN sh -c "! ls /tmp/.dockerignore" |
| 2417 | 2417 |
RUN ls /tmp/Dockerfile` |
| 2418 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2418 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2419 | 2419 |
build.WithFile("Dockerfile", dockerfile),
|
| 2420 | 2420 |
build.WithFile(".dockerignore", ".dockerignore\n"),
|
| 2421 | 2421 |
)) |
| ... | ... |
@@ -2472,7 +2472,7 @@ func (s *DockerCLIBuildSuite) TestBuildDockerignoringWholeDir(c *testing.T) {
|
| 2472 | 2472 |
RUN sh -c "[[ ! -e /.gitignore ]]" |
| 2473 | 2473 |
RUN sh -c "[[ ! -e /Makefile ]]"` |
| 2474 | 2474 |
|
| 2475 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2475 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2476 | 2476 |
build.WithFile("Dockerfile", dockerfile),
|
| 2477 | 2477 |
build.WithFile(".dockerignore", "*\n"),
|
| 2478 | 2478 |
build.WithFile("Makefile", "all:"),
|
| ... | ... |
@@ -2489,7 +2489,7 @@ func (s *DockerCLIBuildSuite) TestBuildDockerignoringOnlyDotfiles(c *testing.T) |
| 2489 | 2489 |
RUN sh -c "[[ ! -e /.gitignore ]]" |
| 2490 | 2490 |
RUN sh -c "[[ -f /Makefile ]]"` |
| 2491 | 2491 |
|
| 2492 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2492 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2493 | 2493 |
build.WithFile("Dockerfile", dockerfile),
|
| 2494 | 2494 |
build.WithFile(".dockerignore", ".*"),
|
| 2495 | 2495 |
build.WithFile("Makefile", "all:"),
|
| ... | ... |
@@ -2525,7 +2525,7 @@ func (s *DockerCLIBuildSuite) TestBuildDockerignoringWildTopDir(c *testing.T) {
|
| 2525 | 2525 |
|
| 2526 | 2526 |
// All of these should result in ignoring all files |
| 2527 | 2527 |
for _, variant := range []string{"**", "**/", "**/**", "*"} {
|
| 2528 |
- buildImageSuccessfully(c, "noname", build.WithBuildContext(c, |
|
| 2528 |
+ cli.BuildCmd(c, "noname", build.WithBuildContext(c, |
|
| 2529 | 2529 |
build.WithFile("Dockerfile", dockerfile),
|
| 2530 | 2530 |
build.WithFile("file1", ""),
|
| 2531 | 2531 |
build.WithFile("dir/file1", ""),
|
| ... | ... |
@@ -2577,7 +2577,7 @@ dir1/dir3/** |
| 2577 | 2577 |
**/dir5/file. |
| 2578 | 2578 |
` |
| 2579 | 2579 |
|
| 2580 |
- buildImageSuccessfully(c, "noname", build.WithBuildContext(c, |
|
| 2580 |
+ cli.BuildCmd(c, "noname", build.WithBuildContext(c, |
|
| 2581 | 2581 |
build.WithFile("Dockerfile", dockerfile),
|
| 2582 | 2582 |
build.WithFile(".dockerignore", dockerignore),
|
| 2583 | 2583 |
build.WithFile("dir1/file0", ""),
|
| ... | ... |
@@ -2602,7 +2602,7 @@ dir1/dir3/** |
| 2602 | 2602 |
func (s *DockerCLIBuildSuite) TestBuildLineBreak(c *testing.T) {
|
| 2603 | 2603 |
testRequires(c, DaemonIsLinux) |
| 2604 | 2604 |
const name = "testbuildlinebreak" |
| 2605 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 2605 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 2606 | 2606 |
RUN sh -c 'echo root:testpass \ |
| 2607 | 2607 |
> /tmp/passwd' |
| 2608 | 2608 |
RUN mkdir -p /var/run/sshd |
| ... | ... |
@@ -2613,7 +2613,7 @@ RUN sh -c "[ "$(ls -d /var/run/sshd)" = "/var/run/sshd" ]"`)) |
| 2613 | 2613 |
func (s *DockerCLIBuildSuite) TestBuildEOLInLine(c *testing.T) {
|
| 2614 | 2614 |
testRequires(c, DaemonIsLinux) |
| 2615 | 2615 |
const name = "testbuildeolinline" |
| 2616 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 2616 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 2617 | 2617 |
RUN sh -c 'echo root:testpass > /tmp/passwd' |
| 2618 | 2618 |
RUN echo "foo \n bar"; echo "baz" |
| 2619 | 2619 |
RUN mkdir -p /var/run/sshd |
| ... | ... |
@@ -2624,7 +2624,7 @@ RUN sh -c "[ "$(ls -d /var/run/sshd)" = "/var/run/sshd" ]"`)) |
| 2624 | 2624 |
func (s *DockerCLIBuildSuite) TestBuildCommentsShebangs(c *testing.T) {
|
| 2625 | 2625 |
testRequires(c, DaemonIsLinux) |
| 2626 | 2626 |
const name = "testbuildcomments" |
| 2627 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 2627 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 2628 | 2628 |
# This is an ordinary comment. |
| 2629 | 2629 |
RUN { echo '#!/bin/sh'; echo 'echo hello world'; } > /hello.sh
|
| 2630 | 2630 |
RUN [ ! -x /hello.sh ] |
| ... | ... |
@@ -2638,7 +2638,7 @@ RUN [ "$(/hello.sh)" = "hello world" ]`)) |
| 2638 | 2638 |
func (s *DockerCLIBuildSuite) TestBuildUsersAndGroups(c *testing.T) {
|
| 2639 | 2639 |
testRequires(c, DaemonIsLinux) |
| 2640 | 2640 |
const name = "testbuildusers" |
| 2641 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 2641 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 2642 | 2642 |
|
| 2643 | 2643 |
# Make sure our defaults work |
| 2644 | 2644 |
RUN [ "$(id -u):$(id -g)/$(id -un):$(id -gn)" = '0:0/root:root' ] |
| ... | ... |
@@ -2715,7 +2715,7 @@ ENV abc=def |
| 2715 | 2715 |
ENV ghi=$abc |
| 2716 | 2716 |
RUN [ "$ghi" = "def" ] |
| 2717 | 2717 |
` |
| 2718 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2718 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2719 | 2719 |
build.WithFile("Dockerfile", dockerfile),
|
| 2720 | 2720 |
build.WithFile("hello/docker/world", "hello"),
|
| 2721 | 2721 |
)) |
| ... | ... |
@@ -2785,7 +2785,7 @@ ENV eee4 'foo' |
| 2785 | 2785 |
RUN [ "$eee1,$eee2,$eee3,$eee4" = 'foo,foo,foo,foo' ] |
| 2786 | 2786 |
|
| 2787 | 2787 |
` |
| 2788 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2788 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2789 | 2789 |
build.WithFile("Dockerfile", dockerfile),
|
| 2790 | 2790 |
build.WithFile("hello/docker/world", "hello"),
|
| 2791 | 2791 |
)) |
| ... | ... |
@@ -2801,7 +2801,7 @@ RUN ["chmod","+x","/test"] |
| 2801 | 2801 |
RUN ["/test"] |
| 2802 | 2802 |
RUN [ "$(cat /testfile)" = 'test!' ]` |
| 2803 | 2803 |
|
| 2804 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2804 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2805 | 2805 |
build.WithFile("Dockerfile", dockerfile),
|
| 2806 | 2806 |
build.WithFile("test", "#!/bin/sh\necho 'test!' > /testfile"),
|
| 2807 | 2807 |
)) |
| ... | ... |
@@ -2858,7 +2858,7 @@ RUN cat /existing-directory-trailing-slash/test/foo | grep Hi` |
| 2858 | 2858 |
}() |
| 2859 | 2859 |
defer ctx.Close() |
| 2860 | 2860 |
|
| 2861 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 2861 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 2862 | 2862 |
} |
| 2863 | 2863 |
|
| 2864 | 2864 |
func (s *DockerCLIBuildSuite) TestBuildAddBrokenTar(c *testing.T) {
|
| ... | ... |
@@ -2916,7 +2916,7 @@ func (s *DockerCLIBuildSuite) TestBuildAddNonTar(c *testing.T) {
|
| 2916 | 2916 |
const name = "testbuildaddnontar" |
| 2917 | 2917 |
|
| 2918 | 2918 |
// Should not try to extract test.tar |
| 2919 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 2919 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 2920 | 2920 |
build.WithFile("Dockerfile", `
|
| 2921 | 2921 |
FROM busybox |
| 2922 | 2922 |
ADD test.tar / |
| ... | ... |
@@ -2971,7 +2971,7 @@ func (s *DockerCLIBuildSuite) TestBuildAddTarXz(c *testing.T) {
|
| 2971 | 2971 |
|
| 2972 | 2972 |
defer ctx.Close() |
| 2973 | 2973 |
|
| 2974 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 2974 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 2975 | 2975 |
} |
| 2976 | 2976 |
|
| 2977 | 2977 |
func (s *DockerCLIBuildSuite) TestBuildAddTarXzGz(c *testing.T) {
|
| ... | ... |
@@ -3023,7 +3023,7 @@ func (s *DockerCLIBuildSuite) TestBuildAddTarXzGz(c *testing.T) {
|
| 3023 | 3023 |
|
| 3024 | 3024 |
defer ctx.Close() |
| 3025 | 3025 |
|
| 3026 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 3026 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 3027 | 3027 |
} |
| 3028 | 3028 |
|
| 3029 | 3029 |
// FIXME(vdemeester) most of the from git tests could be moved to `docker/cli` e2e tests |
| ... | ... |
@@ -3038,7 +3038,7 @@ func (s *DockerCLIBuildSuite) TestBuildFromGit(c *testing.T) {
|
| 3038 | 3038 |
}, true) |
| 3039 | 3039 |
defer git.Close() |
| 3040 | 3040 |
|
| 3041 |
- buildImageSuccessfully(c, name, build.WithContextPath(git.RepoURL)) |
|
| 3041 |
+ cli.BuildCmd(c, name, build.WithContextPath(git.RepoURL)) |
|
| 3042 | 3042 |
|
| 3043 | 3043 |
res := inspectField(c, name, "Author") |
| 3044 | 3044 |
if res != "docker" {
|
| ... | ... |
@@ -3057,7 +3057,7 @@ func (s *DockerCLIBuildSuite) TestBuildFromGitWithContext(c *testing.T) {
|
| 3057 | 3057 |
}, true) |
| 3058 | 3058 |
defer git.Close() |
| 3059 | 3059 |
|
| 3060 |
- buildImageSuccessfully(c, name, build.WithContextPath(fmt.Sprintf("%s#master:docker", git.RepoURL)))
|
|
| 3060 |
+ cli.BuildCmd(c, name, build.WithContextPath(fmt.Sprintf("%s#master:docker", git.RepoURL)))
|
|
| 3061 | 3061 |
|
| 3062 | 3062 |
res := inspectField(c, name, "Author") |
| 3063 | 3063 |
if res != "docker" {
|
| ... | ... |
@@ -3116,10 +3116,10 @@ func (s *DockerCLIBuildSuite) TestBuildFromRemoteTarball(c *testing.T) {
|
| 3116 | 3116 |
func (s *DockerCLIBuildSuite) TestBuildCleanupCmdOnEntrypoint(c *testing.T) {
|
| 3117 | 3117 |
const name = "testbuildcmdcleanuponentrypoint" |
| 3118 | 3118 |
|
| 3119 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 3119 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 3120 | 3120 |
CMD ["test"] |
| 3121 | 3121 |
ENTRYPOINT ["echo"]`)) |
| 3122 |
- buildImageSuccessfully(c, name, build.WithDockerfile(fmt.Sprintf(`FROM %s |
|
| 3122 |
+ cli.BuildCmd(c, name, build.WithDockerfile(fmt.Sprintf(`FROM %s |
|
| 3123 | 3123 |
ENTRYPOINT ["cat"]`, name))) |
| 3124 | 3124 |
|
| 3125 | 3125 |
res := inspectField(c, name, "Config.Cmd") |
| ... | ... |
@@ -3134,7 +3134,7 @@ func (s *DockerCLIBuildSuite) TestBuildCleanupCmdOnEntrypoint(c *testing.T) {
|
| 3134 | 3134 |
|
| 3135 | 3135 |
func (s *DockerCLIBuildSuite) TestBuildClearCmd(c *testing.T) {
|
| 3136 | 3136 |
const name = "testbuildclearcmd" |
| 3137 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 3137 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 3138 | 3138 |
ENTRYPOINT ["/bin/bash"] |
| 3139 | 3139 |
CMD []`)) |
| 3140 | 3140 |
|
| ... | ... |
@@ -3147,7 +3147,7 @@ func (s *DockerCLIBuildSuite) TestBuildEmptyCmd(c *testing.T) {
|
| 3147 | 3147 |
testRequires(c, DaemonIsLinux) |
| 3148 | 3148 |
|
| 3149 | 3149 |
const name = "testbuildemptycmd" |
| 3150 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM "+minimalBaseImage()+"\nMAINTAINER quux\n"))
|
|
| 3150 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM "+minimalBaseImage()+"\nMAINTAINER quux\n"))
|
|
| 3151 | 3151 |
|
| 3152 | 3152 |
res := inspectFieldJSON(c, name, "Config.Cmd") |
| 3153 | 3153 |
if res != "null" {
|
| ... | ... |
@@ -3157,7 +3157,7 @@ func (s *DockerCLIBuildSuite) TestBuildEmptyCmd(c *testing.T) {
|
| 3157 | 3157 |
|
| 3158 | 3158 |
func (s *DockerCLIBuildSuite) TestBuildOnBuildOutput(c *testing.T) {
|
| 3159 | 3159 |
const name = "testbuildonbuildparent" |
| 3160 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM busybox\nONBUILD RUN echo foo\n"))
|
|
| 3160 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM busybox\nONBUILD RUN echo foo\n"))
|
|
| 3161 | 3161 |
|
| 3162 | 3162 |
buildImage(name, build.WithDockerfile("FROM "+name+"\nMAINTAINER quux\n")).Assert(c, icmd.Expected{
|
| 3163 | 3163 |
Out: "# Executing 1 build trigger", |
| ... | ... |
@@ -3175,7 +3175,7 @@ func (s *DockerCLIBuildSuite) TestBuildInvalidTag(c *testing.T) {
|
| 3175 | 3175 |
|
| 3176 | 3176 |
func (s *DockerCLIBuildSuite) TestBuildCmdShDashC(c *testing.T) {
|
| 3177 | 3177 |
const name = "testbuildcmdshc" |
| 3178 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM busybox\nCMD echo cmd\n"))
|
|
| 3178 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM busybox\nCMD echo cmd\n"))
|
|
| 3179 | 3179 |
|
| 3180 | 3180 |
res := inspectFieldJSON(c, name, "Config.Cmd") |
| 3181 | 3181 |
expected := `["/bin/sh","-c","echo cmd"]` |
| ... | ... |
@@ -3193,9 +3193,9 @@ func (s *DockerCLIBuildSuite) TestBuildCmdSpaces(c *testing.T) {
|
| 3193 | 3193 |
// look the same |
| 3194 | 3194 |
const name = "testbuildcmdspaces" |
| 3195 | 3195 |
|
| 3196 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM busybox\nCMD [\"echo hi\"]\n"))
|
|
| 3196 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM busybox\nCMD [\"echo hi\"]\n"))
|
|
| 3197 | 3197 |
id1 := getIDByName(c, name) |
| 3198 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM busybox\nCMD [\"echo\", \"hi\"]\n"))
|
|
| 3198 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM busybox\nCMD [\"echo\", \"hi\"]\n"))
|
|
| 3199 | 3199 |
id2 := getIDByName(c, name) |
| 3200 | 3200 |
|
| 3201 | 3201 |
if id1 == id2 {
|
| ... | ... |
@@ -3203,9 +3203,9 @@ func (s *DockerCLIBuildSuite) TestBuildCmdSpaces(c *testing.T) {
|
| 3203 | 3203 |
} |
| 3204 | 3204 |
|
| 3205 | 3205 |
// Now do the same with ENTRYPOINT |
| 3206 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM busybox\nENTRYPOINT [\"echo hi\"]\n"))
|
|
| 3206 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM busybox\nENTRYPOINT [\"echo hi\"]\n"))
|
|
| 3207 | 3207 |
id1 = getIDByName(c, name) |
| 3208 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM busybox\nENTRYPOINT [\"echo\", \"hi\"]\n"))
|
|
| 3208 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM busybox\nENTRYPOINT [\"echo\", \"hi\"]\n"))
|
|
| 3209 | 3209 |
id2 = getIDByName(c, name) |
| 3210 | 3210 |
|
| 3211 | 3211 |
if id1 == id2 {
|
| ... | ... |
@@ -3215,7 +3215,7 @@ func (s *DockerCLIBuildSuite) TestBuildCmdSpaces(c *testing.T) {
|
| 3215 | 3215 |
|
| 3216 | 3216 |
func (s *DockerCLIBuildSuite) TestBuildCmdJSONNoShDashC(c *testing.T) {
|
| 3217 | 3217 |
const name = "testbuildcmdjson" |
| 3218 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM busybox\nCMD [\"echo\", \"cmd\"]"))
|
|
| 3218 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM busybox\nCMD [\"echo\", \"cmd\"]"))
|
|
| 3219 | 3219 |
|
| 3220 | 3220 |
res := inspectFieldJSON(c, name, "Config.Cmd") |
| 3221 | 3221 |
expected := `["echo","cmd"]` |
| ... | ... |
@@ -3225,7 +3225,7 @@ func (s *DockerCLIBuildSuite) TestBuildCmdJSONNoShDashC(c *testing.T) {
|
| 3225 | 3225 |
} |
| 3226 | 3226 |
|
| 3227 | 3227 |
func (s *DockerCLIBuildSuite) TestBuildEntrypointCanBeOverriddenByChild(c *testing.T) {
|
| 3228 |
- buildImageSuccessfully(c, "parent", build.WithDockerfile(` |
|
| 3228 |
+ cli.BuildCmd(c, "parent", build.WithDockerfile(` |
|
| 3229 | 3229 |
FROM busybox |
| 3230 | 3230 |
ENTRYPOINT exit 130 |
| 3231 | 3231 |
`)) |
| ... | ... |
@@ -3234,7 +3234,7 @@ func (s *DockerCLIBuildSuite) TestBuildEntrypointCanBeOverriddenByChild(c *testi |
| 3234 | 3234 |
ExitCode: 130, |
| 3235 | 3235 |
}) |
| 3236 | 3236 |
|
| 3237 |
- buildImageSuccessfully(c, "child", build.WithDockerfile(` |
|
| 3237 |
+ cli.BuildCmd(c, "child", build.WithDockerfile(` |
|
| 3238 | 3238 |
FROM parent |
| 3239 | 3239 |
ENTRYPOINT exit 5 |
| 3240 | 3240 |
`)) |
| ... | ... |
@@ -3255,8 +3255,8 @@ func (s *DockerCLIBuildSuite) TestBuildEntrypointCanBeOverriddenByChildInspect(c |
| 3255 | 3255 |
expected = `["cmd /S /C echo quux"]` |
| 3256 | 3256 |
} |
| 3257 | 3257 |
|
| 3258 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM busybox\nENTRYPOINT /foo/bar"))
|
|
| 3259 |
- buildImageSuccessfully(c, name2, build.WithDockerfile(fmt.Sprintf("FROM %s\nENTRYPOINT echo quux", name)))
|
|
| 3258 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM busybox\nENTRYPOINT /foo/bar"))
|
|
| 3259 |
+ cli.BuildCmd(c, name2, build.WithDockerfile(fmt.Sprintf("FROM %s\nENTRYPOINT echo quux", name)))
|
|
| 3260 | 3260 |
|
| 3261 | 3261 |
res := inspectFieldJSON(c, name2, "Config.Entrypoint") |
| 3262 | 3262 |
if res != expected {
|
| ... | ... |
@@ -3270,7 +3270,7 @@ func (s *DockerCLIBuildSuite) TestBuildEntrypointCanBeOverriddenByChildInspect(c |
| 3270 | 3270 |
|
| 3271 | 3271 |
func (s *DockerCLIBuildSuite) TestBuildRunShEntrypoint(c *testing.T) {
|
| 3272 | 3272 |
const name = "testbuildentrypoint" |
| 3273 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 3273 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 3274 | 3274 |
ENTRYPOINT echo`)) |
| 3275 | 3275 |
cli.DockerCmd(c, "run", "--rm", name) |
| 3276 | 3276 |
} |
| ... | ... |
@@ -3279,7 +3279,7 @@ func (s *DockerCLIBuildSuite) TestBuildExoticShellInterpolation(c *testing.T) {
|
| 3279 | 3279 |
testRequires(c, DaemonIsLinux) |
| 3280 | 3280 |
const name = "testbuildexoticshellinterpolation" |
| 3281 | 3281 |
|
| 3282 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 3282 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 3283 | 3283 |
FROM busybox |
| 3284 | 3284 |
|
| 3285 | 3285 |
ENV SOME_VAR a.b.c |
| ... | ... |
@@ -3309,7 +3309,7 @@ func (s *DockerCLIBuildSuite) TestBuildVerifySingleQuoteFails(c *testing.T) {
|
| 3309 | 3309 |
const name = "testbuildsinglequotefails" |
| 3310 | 3310 |
expectedExitCode := 2 |
| 3311 | 3311 |
|
| 3312 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 3312 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 3313 | 3313 |
CMD [ '/bin/sh', '-c', 'echo hi' ]`)) |
| 3314 | 3314 |
|
| 3315 | 3315 |
icmd.RunCommand(dockerBinary, "run", "--rm", name).Assert(c, icmd.Expected{
|
| ... | ... |
@@ -3336,7 +3336,7 @@ func (s *DockerCLIBuildSuite) TestBuildWithTabs(c *testing.T) {
|
| 3336 | 3336 |
skip.If(c, testEnv.UsingSnapshotter, "ContainerConfig is not filled in c8d") |
| 3337 | 3337 |
|
| 3338 | 3338 |
const name = "testbuildwithtabs" |
| 3339 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM busybox\nRUN echo\tone\t\ttwo"))
|
|
| 3339 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM busybox\nRUN echo\tone\t\ttwo"))
|
|
| 3340 | 3340 |
res := inspectFieldJSON(c, name, "ContainerConfig.Cmd") |
| 3341 | 3341 |
expected1 := `["/bin/sh","-c","echo\tone\t\ttwo"]` |
| 3342 | 3342 |
expected2 := `["/bin/sh","-c","echo\u0009one\u0009\u0009two"]` // syntactically equivalent, and what Go 1.3 generates |
| ... | ... |
@@ -3352,7 +3352,7 @@ func (s *DockerCLIBuildSuite) TestBuildWithTabs(c *testing.T) {
|
| 3352 | 3352 |
func (s *DockerCLIBuildSuite) TestBuildLabels(c *testing.T) {
|
| 3353 | 3353 |
const name = "testbuildlabel" |
| 3354 | 3354 |
expected := `{"License":"GPL","Vendor":"Acme"}`
|
| 3355 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 3355 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 3356 | 3356 |
LABEL Vendor=Acme |
| 3357 | 3357 |
LABEL License GPL`)) |
| 3358 | 3358 |
res := inspectFieldJSON(c, name, "Config.Labels") |
| ... | ... |
@@ -3364,24 +3364,24 @@ func (s *DockerCLIBuildSuite) TestBuildLabels(c *testing.T) {
|
| 3364 | 3364 |
func (s *DockerCLIBuildSuite) TestBuildLabelsCache(c *testing.T) {
|
| 3365 | 3365 |
const name = "testbuildlabelcache" |
| 3366 | 3366 |
|
| 3367 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 3367 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 3368 | 3368 |
LABEL Vendor=Acme`)) |
| 3369 | 3369 |
id1 := getIDByName(c, name) |
| 3370 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 3370 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 3371 | 3371 |
LABEL Vendor=Acme`)) |
| 3372 | 3372 |
id2 := getIDByName(c, name) |
| 3373 | 3373 |
if id1 != id2 {
|
| 3374 | 3374 |
c.Fatalf("Build 2 should have worked & used cache(%s,%s)", id1, id2)
|
| 3375 | 3375 |
} |
| 3376 | 3376 |
|
| 3377 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 3377 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 3378 | 3378 |
LABEL Vendor=Acme1`)) |
| 3379 | 3379 |
id2 = getIDByName(c, name) |
| 3380 | 3380 |
if id1 == id2 {
|
| 3381 | 3381 |
c.Fatalf("Build 3 should have worked & NOT used cache(%s,%s)", id1, id2)
|
| 3382 | 3382 |
} |
| 3383 | 3383 |
|
| 3384 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 3384 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 3385 | 3385 |
LABEL Vendor Acme`)) |
| 3386 | 3386 |
id2 = getIDByName(c, name) |
| 3387 | 3387 |
if id1 != id2 {
|
| ... | ... |
@@ -3389,10 +3389,10 @@ func (s *DockerCLIBuildSuite) TestBuildLabelsCache(c *testing.T) {
|
| 3389 | 3389 |
} |
| 3390 | 3390 |
|
| 3391 | 3391 |
// Now make sure the cache isn't used by mistake |
| 3392 |
- buildImageSuccessfully(c, name, build.WithoutCache, build.WithDockerfile(`FROM busybox |
|
| 3392 |
+ cli.BuildCmd(c, name, build.WithoutCache, build.WithDockerfile(`FROM busybox |
|
| 3393 | 3393 |
LABEL f1=b1 f2=b2`)) |
| 3394 | 3394 |
|
| 3395 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 3395 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 3396 | 3396 |
LABEL f1=b1 f2=b2`)) |
| 3397 | 3397 |
id2 = getIDByName(c, name) |
| 3398 | 3398 |
if id1 == id2 {
|
| ... | ... |
@@ -3620,7 +3620,7 @@ func (s *DockerCLIBuildSuite) TestBuildSymlinkBreakout(c *testing.T) {
|
| 3620 | 3620 |
w.Close() |
| 3621 | 3621 |
f.Close() |
| 3622 | 3622 |
|
| 3623 |
- buildImageSuccessfully(c, name, build.WithoutCache, build.WithExternalBuildContext(fakecontext.New(c, ctx))) |
|
| 3623 |
+ cli.BuildCmd(c, name, build.WithoutCache, build.WithExternalBuildContext(fakecontext.New(c, ctx))) |
|
| 3624 | 3624 |
if _, err := os.Lstat(filepath.Join(tmpdir, "inject")); err == nil {
|
| 3625 | 3625 |
c.Fatal("symlink breakout - inject")
|
| 3626 | 3626 |
} else if !os.IsNotExist(err) {
|
| ... | ... |
@@ -3634,7 +3634,7 @@ func (s *DockerCLIBuildSuite) TestBuildXZHost(c *testing.T) {
|
| 3634 | 3634 |
testRequires(c, DaemonIsLinux) |
| 3635 | 3635 |
const name = "testbuildxzhost" |
| 3636 | 3636 |
|
| 3637 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 3637 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 3638 | 3638 |
build.WithFile("Dockerfile", `
|
| 3639 | 3639 |
FROM busybox |
| 3640 | 3640 |
ADD xz /usr/local/sbin/ |
| ... | ... |
@@ -3660,7 +3660,7 @@ func (s *DockerCLIBuildSuite) TestBuildVolumesRetainContents(c *testing.T) {
|
| 3660 | 3660 |
volName = "C:/foo" |
| 3661 | 3661 |
} |
| 3662 | 3662 |
|
| 3663 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 3663 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 3664 | 3664 |
build.WithFile("Dockerfile", `
|
| 3665 | 3665 |
FROM busybox |
| 3666 | 3666 |
COPY content /foo/file |
| ... | ... |
@@ -3761,7 +3761,7 @@ func (s *DockerCLIBuildSuite) TestBuildFromOfficialNames(c *testing.T) {
|
| 3761 | 3761 |
} |
| 3762 | 3762 |
for idx, fromName := range fromNames {
|
| 3763 | 3763 |
imgName := fmt.Sprintf("%s%d", name, idx)
|
| 3764 |
- buildImageSuccessfully(c, imgName, build.WithDockerfile("FROM "+fromName))
|
|
| 3764 |
+ cli.BuildCmd(c, imgName, build.WithDockerfile("FROM "+fromName))
|
|
| 3765 | 3765 |
cli.DockerCmd(c, "rmi", imgName) |
| 3766 | 3766 |
} |
| 3767 | 3767 |
} |
| ... | ... |
@@ -3915,7 +3915,7 @@ func (s *DockerCLIBuildSuite) TestBuildEmptyScratch(c *testing.T) {
|
| 3915 | 3915 |
} |
| 3916 | 3916 |
|
| 3917 | 3917 |
func (s *DockerCLIBuildSuite) TestBuildDotDotFile(c *testing.T) {
|
| 3918 |
- buildImageSuccessfully(c, "sc", build.WithBuildContext(c, |
|
| 3918 |
+ cli.BuildCmd(c, "sc", build.WithBuildContext(c, |
|
| 3919 | 3919 |
build.WithFile("Dockerfile", "FROM busybox\n"),
|
| 3920 | 3920 |
build.WithFile("..gitme", ""),
|
| 3921 | 3921 |
)) |
| ... | ... |
@@ -4029,7 +4029,7 @@ func (s *DockerCLIBuildSuite) TestBuildNullStringInAddCopyVolume(c *testing.T) {
|
| 4029 | 4029 |
volName = `C:\\nullvolume` |
| 4030 | 4030 |
} |
| 4031 | 4031 |
|
| 4032 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 4032 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 4033 | 4033 |
build.WithFile("Dockerfile", `
|
| 4034 | 4034 |
FROM busybox |
| 4035 | 4035 |
|
| ... | ... |
@@ -4045,7 +4045,7 @@ func (s *DockerCLIBuildSuite) TestBuildNullStringInAddCopyVolume(c *testing.T) {
|
| 4045 | 4045 |
func (s *DockerCLIBuildSuite) TestBuildStopSignal(c *testing.T) {
|
| 4046 | 4046 |
testRequires(c, DaemonIsLinux) // Windows does not support STOPSIGNAL yet |
| 4047 | 4047 |
imgName := "test_build_stop_signal" |
| 4048 |
- buildImageSuccessfully(c, imgName, build.WithDockerfile(`FROM busybox |
|
| 4048 |
+ cli.BuildCmd(c, imgName, build.WithDockerfile(`FROM busybox |
|
| 4049 | 4049 |
STOPSIGNAL SIGKILL`)) |
| 4050 | 4050 |
res := inspectFieldJSON(c, imgName, "Config.StopSignal") |
| 4051 | 4051 |
if res != `"SIGKILL"` {
|
| ... | ... |
@@ -4160,14 +4160,14 @@ func (s *DockerCLIBuildSuite) TestBuildBuildTimeArgCacheHit(c *testing.T) {
|
| 4160 | 4160 |
dockerfile := fmt.Sprintf(`FROM busybox |
| 4161 | 4161 |
ARG %s |
| 4162 | 4162 |
RUN echo $%s`, envKey, envKey) |
| 4163 |
- buildImageSuccessfully(c, imgName, |
|
| 4163 |
+ cli.BuildCmd(c, imgName, |
|
| 4164 | 4164 |
cli.WithFlags("--build-arg", fmt.Sprintf("%s=%s", envKey, envVal)),
|
| 4165 | 4165 |
build.WithDockerfile(dockerfile), |
| 4166 | 4166 |
) |
| 4167 | 4167 |
origImgID := getIDByName(c, imgName) |
| 4168 | 4168 |
|
| 4169 | 4169 |
imgNameCache := "bldargtestcachehit" |
| 4170 |
- buildImageSuccessfully(c, imgNameCache, |
|
| 4170 |
+ cli.BuildCmd(c, imgNameCache, |
|
| 4171 | 4171 |
cli.WithFlags("--build-arg", fmt.Sprintf("%s=%s", envKey, envVal)),
|
| 4172 | 4172 |
build.WithDockerfile(dockerfile), |
| 4173 | 4173 |
) |
| ... | ... |
@@ -4187,14 +4187,14 @@ func (s *DockerCLIBuildSuite) TestBuildBuildTimeArgCacheMissExtraArg(c *testing. |
| 4187 | 4187 |
ARG %s |
| 4188 | 4188 |
ARG %s |
| 4189 | 4189 |
RUN echo $%s`, envKey, extraEnvKey, envKey) |
| 4190 |
- buildImageSuccessfully(c, imgName, |
|
| 4190 |
+ cli.BuildCmd(c, imgName, |
|
| 4191 | 4191 |
cli.WithFlags("--build-arg", fmt.Sprintf("%s=%s", envKey, envVal)),
|
| 4192 | 4192 |
build.WithDockerfile(dockerfile), |
| 4193 | 4193 |
) |
| 4194 | 4194 |
origImgID := getIDByName(c, imgName) |
| 4195 | 4195 |
|
| 4196 | 4196 |
imgNameCache := "bldargtestcachemiss" |
| 4197 |
- buildImageSuccessfully(c, imgNameCache, |
|
| 4197 |
+ cli.BuildCmd(c, imgNameCache, |
|
| 4198 | 4198 |
cli.WithFlags( |
| 4199 | 4199 |
"--build-arg", fmt.Sprintf("%s=%s", envKey, envVal),
|
| 4200 | 4200 |
"--build-arg", fmt.Sprintf("%s=%s", extraEnvKey, extraEnvVal),
|
| ... | ... |
@@ -4216,14 +4216,14 @@ func (s *DockerCLIBuildSuite) TestBuildBuildTimeArgCacheMissSameArgDiffVal(c *te |
| 4216 | 4216 |
dockerfile := fmt.Sprintf(`FROM busybox |
| 4217 | 4217 |
ARG %s |
| 4218 | 4218 |
RUN echo $%s`, envKey, envKey) |
| 4219 |
- buildImageSuccessfully(c, imgName, |
|
| 4219 |
+ cli.BuildCmd(c, imgName, |
|
| 4220 | 4220 |
cli.WithFlags("--build-arg", fmt.Sprintf("%s=%s", envKey, envVal)),
|
| 4221 | 4221 |
build.WithDockerfile(dockerfile), |
| 4222 | 4222 |
) |
| 4223 | 4223 |
origImgID := getIDByName(c, imgName) |
| 4224 | 4224 |
|
| 4225 | 4225 |
imgNameCache := "bldargtestcachemiss" |
| 4226 |
- buildImageSuccessfully(c, imgNameCache, |
|
| 4226 |
+ cli.BuildCmd(c, imgNameCache, |
|
| 4227 | 4227 |
cli.WithFlags("--build-arg", fmt.Sprintf("%s=%s", envKey, newEnvVal)),
|
| 4228 | 4228 |
build.WithDockerfile(dockerfile), |
| 4229 | 4229 |
) |
| ... | ... |
@@ -4311,7 +4311,7 @@ func (s *DockerCLIBuildSuite) TestBuildBuildTimeArgExpansion(c *testing.T) {
|
| 4311 | 4311 |
wdVal = "C:\\tmp" |
| 4312 | 4312 |
} |
| 4313 | 4313 |
|
| 4314 |
- buildImageSuccessfully(c, imgName, |
|
| 4314 |
+ cli.BuildCmd(c, imgName, |
|
| 4315 | 4315 |
cli.WithFlags( |
| 4316 | 4316 |
"--build-arg", fmt.Sprintf("%s=%s", wdVar, wdVal),
|
| 4317 | 4317 |
"--build-arg", fmt.Sprintf("%s=%s", addVar, addVal),
|
| ... | ... |
@@ -4574,7 +4574,7 @@ func (s *DockerCLIBuildSuite) TestBuildBuildTimeArgQuotedValVariants(c *testing. |
| 4574 | 4574 |
RUN [ "$%s" != "$%s" ]`, envKey, envKey1, envKey2, envKey3, |
| 4575 | 4575 |
envKey, envKey2, envKey, envKey3, envKey1, envKey2, envKey1, envKey3, |
| 4576 | 4576 |
envKey2, envKey3) |
| 4577 |
- buildImageSuccessfully(c, imgName, build.WithDockerfile(dockerfile)) |
|
| 4577 |
+ cli.BuildCmd(c, imgName, build.WithDockerfile(dockerfile)) |
|
| 4578 | 4578 |
} |
| 4579 | 4579 |
|
| 4580 | 4580 |
func (s *DockerCLIBuildSuite) TestBuildBuildTimeArgEmptyValVariants(c *testing.T) {
|
| ... | ... |
@@ -4590,7 +4590,7 @@ func (s *DockerCLIBuildSuite) TestBuildBuildTimeArgEmptyValVariants(c *testing.T |
| 4590 | 4590 |
RUN [ "$%s" = "$%s" ] |
| 4591 | 4591 |
RUN [ "$%s" = "$%s" ] |
| 4592 | 4592 |
RUN [ "$%s" = "$%s" ]`, envKey, envKey1, envKey2, envKey, envKey1, envKey1, envKey2, envKey, envKey2) |
| 4593 |
- buildImageSuccessfully(c, imgName, build.WithDockerfile(dockerfile)) |
|
| 4593 |
+ cli.BuildCmd(c, imgName, build.WithDockerfile(dockerfile)) |
|
| 4594 | 4594 |
} |
| 4595 | 4595 |
|
| 4596 | 4596 |
func (s *DockerCLIBuildSuite) TestBuildBuildTimeArgDefinitionWithNoEnvInjection(c *testing.T) {
|
| ... | ... |
@@ -4706,7 +4706,7 @@ func (s *DockerCLIBuildSuite) TestBuildTagEvent(c *testing.T) {
|
| 4706 | 4706 |
dockerFile := `FROM busybox |
| 4707 | 4707 |
RUN echo events |
| 4708 | 4708 |
` |
| 4709 |
- buildImageSuccessfully(c, "test", build.WithDockerfile(dockerFile)) |
|
| 4709 |
+ cli.BuildCmd(c, "test", build.WithDockerfile(dockerFile)) |
|
| 4710 | 4710 |
|
| 4711 | 4711 |
until := daemonUnixTime(c) |
| 4712 | 4712 |
out := cli.DockerCmd(c, "events", "--since", since, "--until", until, "--filter", "type=image").Stdout() |
| ... | ... |
@@ -4729,7 +4729,7 @@ func (s *DockerCLIBuildSuite) TestBuildMultipleTags(c *testing.T) {
|
| 4729 | 4729 |
FROM busybox |
| 4730 | 4730 |
MAINTAINER test-15780 |
| 4731 | 4731 |
` |
| 4732 |
- buildImageSuccessfully(c, "tag1", cli.WithFlags("-t", "tag2:v2", "-t", "tag1:latest", "-t", "tag1"), build.WithDockerfile(dockerfile))
|
|
| 4732 |
+ cli.BuildCmd(c, "tag1", cli.WithFlags("-t", "tag2:v2", "-t", "tag1:latest", "-t", "tag1"), build.WithDockerfile(dockerfile))
|
|
| 4733 | 4733 |
|
| 4734 | 4734 |
id1 := getIDByName(c, "tag1") |
| 4735 | 4735 |
id2 := getIDByName(c, "tag2:v2") |
| ... | ... |
@@ -4889,7 +4889,7 @@ func (s *DockerCLIBuildSuite) TestBuildFailsGitNotCallable(c *testing.T) {
|
| 4889 | 4889 |
func (s *DockerCLIBuildSuite) TestBuildWorkdirWindowsPath(c *testing.T) {
|
| 4890 | 4890 |
testRequires(c, DaemonIsWindows) |
| 4891 | 4891 |
const name = "testbuildworkdirwindowspath" |
| 4892 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 4892 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 4893 | 4893 |
FROM `+testEnv.PlatformDefaults.BaseImage+` |
| 4894 | 4894 |
RUN mkdir C:\\work |
| 4895 | 4895 |
WORKDIR C:\\work |
| ... | ... |
@@ -4901,7 +4901,7 @@ func (s *DockerCLIBuildSuite) TestBuildLabel(c *testing.T) {
|
| 4901 | 4901 |
const name = "testbuildlabel" |
| 4902 | 4902 |
testLabel := "foo" |
| 4903 | 4903 |
|
| 4904 |
- buildImageSuccessfully(c, name, cli.WithFlags("--label", testLabel),
|
|
| 4904 |
+ cli.BuildCmd(c, name, cli.WithFlags("--label", testLabel),
|
|
| 4905 | 4905 |
build.WithDockerfile(` |
| 4906 | 4906 |
FROM `+minimalBaseImage()+` |
| 4907 | 4907 |
LABEL default foo |
| ... | ... |
@@ -4916,7 +4916,7 @@ func (s *DockerCLIBuildSuite) TestBuildLabel(c *testing.T) {
|
| 4916 | 4916 |
|
| 4917 | 4917 |
func (s *DockerCLIBuildSuite) TestBuildLabelOneNode(c *testing.T) {
|
| 4918 | 4918 |
const name = "testbuildlabel" |
| 4919 |
- buildImageSuccessfully(c, name, cli.WithFlags("--label", "foo=bar"),
|
|
| 4919 |
+ cli.BuildCmd(c, name, cli.WithFlags("--label", "foo=bar"),
|
|
| 4920 | 4920 |
build.WithDockerfile("FROM busybox"))
|
| 4921 | 4921 |
|
| 4922 | 4922 |
var labels map[string]string |
| ... | ... |
@@ -4932,11 +4932,11 @@ func (s *DockerCLIBuildSuite) TestBuildLabelCacheCommit(c *testing.T) {
|
| 4932 | 4932 |
const name = "testbuildlabelcachecommit" |
| 4933 | 4933 |
testLabel := "foo" |
| 4934 | 4934 |
|
| 4935 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 4935 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 4936 | 4936 |
FROM `+minimalBaseImage()+` |
| 4937 | 4937 |
LABEL default foo |
| 4938 | 4938 |
`)) |
| 4939 |
- buildImageSuccessfully(c, name, cli.WithFlags("--label", testLabel),
|
|
| 4939 |
+ cli.BuildCmd(c, name, cli.WithFlags("--label", testLabel),
|
|
| 4940 | 4940 |
build.WithDockerfile(` |
| 4941 | 4941 |
FROM `+minimalBaseImage()+` |
| 4942 | 4942 |
LABEL default foo |
| ... | ... |
@@ -4960,7 +4960,7 @@ func (s *DockerCLIBuildSuite) TestBuildLabelMultiple(c *testing.T) {
|
| 4960 | 4960 |
labelArgs = append(labelArgs, "--label", k+"="+v) |
| 4961 | 4961 |
} |
| 4962 | 4962 |
|
| 4963 |
- buildImageSuccessfully(c, name, cli.WithFlags(labelArgs...), |
|
| 4963 |
+ cli.BuildCmd(c, name, cli.WithFlags(labelArgs...), |
|
| 4964 | 4964 |
build.WithDockerfile(` |
| 4965 | 4965 |
FROM `+minimalBaseImage()+` |
| 4966 | 4966 |
LABEL default foo |
| ... | ... |
@@ -4979,7 +4979,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestBuildFromAuthenticatedRegistry(c * |
| 4979 | 4979 |
cli.DockerCmd(c, "login", "-u", s.reg.Username(), "-p", s.reg.Password(), privateRegistryURL) |
| 4980 | 4980 |
baseImage := privateRegistryURL + "/baseimage" |
| 4981 | 4981 |
|
| 4982 |
- buildImageSuccessfully(c, baseImage, build.WithDockerfile(` |
|
| 4982 |
+ cli.BuildCmd(c, baseImage, build.WithDockerfile(` |
|
| 4983 | 4983 |
FROM busybox |
| 4984 | 4984 |
ENV env1 val1 |
| 4985 | 4985 |
`)) |
| ... | ... |
@@ -4987,7 +4987,7 @@ func (s *DockerRegistryAuthHtpasswdSuite) TestBuildFromAuthenticatedRegistry(c * |
| 4987 | 4987 |
cli.DockerCmd(c, "push", baseImage) |
| 4988 | 4988 |
cli.DockerCmd(c, "rmi", baseImage) |
| 4989 | 4989 |
|
| 4990 |
- buildImageSuccessfully(c, baseImage, build.WithDockerfile(fmt.Sprintf(` |
|
| 4990 |
+ cli.BuildCmd(c, baseImage, build.WithDockerfile(fmt.Sprintf(` |
|
| 4991 | 4991 |
FROM %s |
| 4992 | 4992 |
ENV env2 val2 |
| 4993 | 4993 |
`, baseImage))) |
| ... | ... |
@@ -5036,7 +5036,7 @@ func (s *DockerCLIBuildSuite) TestBuildLabelsOverride(c *testing.T) {
|
| 5036 | 5036 |
// Command line option labels will always override |
| 5037 | 5037 |
name := "scratchy" |
| 5038 | 5038 |
expected := `{"bar":"from-flag","foo":"from-flag"}`
|
| 5039 |
- buildImageSuccessfully(c, name, cli.WithFlags("--label", "foo=from-flag", "--label", "bar=from-flag"),
|
|
| 5039 |
+ cli.BuildCmd(c, name, cli.WithFlags("--label", "foo=from-flag", "--label", "bar=from-flag"),
|
|
| 5040 | 5040 |
build.WithDockerfile(`FROM `+minimalBaseImage()+` |
| 5041 | 5041 |
LABEL foo=from-dockerfile`)) |
| 5042 | 5042 |
res := inspectFieldJSON(c, name, "Config.Labels") |
| ... | ... |
@@ -5046,7 +5046,7 @@ func (s *DockerCLIBuildSuite) TestBuildLabelsOverride(c *testing.T) {
|
| 5046 | 5046 |
|
| 5047 | 5047 |
name = "from" |
| 5048 | 5048 |
expected = `{"foo":"from-dockerfile"}`
|
| 5049 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 5049 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 5050 | 5050 |
LABEL foo from-dockerfile`)) |
| 5051 | 5051 |
res = inspectFieldJSON(c, name, "Config.Labels") |
| 5052 | 5052 |
if res != expected {
|
| ... | ... |
@@ -5056,7 +5056,7 @@ func (s *DockerCLIBuildSuite) TestBuildLabelsOverride(c *testing.T) {
|
| 5056 | 5056 |
// Command line option label will override even via `FROM` |
| 5057 | 5057 |
name = "new" |
| 5058 | 5058 |
expected = `{"bar":"from-dockerfile2","foo":"new"}`
|
| 5059 |
- buildImageSuccessfully(c, name, cli.WithFlags("--label", "foo=new"),
|
|
| 5059 |
+ cli.BuildCmd(c, name, cli.WithFlags("--label", "foo=new"),
|
|
| 5060 | 5060 |
build.WithDockerfile(`FROM from |
| 5061 | 5061 |
LABEL bar from-dockerfile2`)) |
| 5062 | 5062 |
res = inspectFieldJSON(c, name, "Config.Labels") |
| ... | ... |
@@ -5068,7 +5068,7 @@ func (s *DockerCLIBuildSuite) TestBuildLabelsOverride(c *testing.T) {
|
| 5068 | 5068 |
// will be treated as --label foo="", --label bar="" |
| 5069 | 5069 |
name = "scratchy2" |
| 5070 | 5070 |
expected = `{"bar":"","foo":""}`
|
| 5071 |
- buildImageSuccessfully(c, name, cli.WithFlags("--label", "foo", "--label", "bar="),
|
|
| 5071 |
+ cli.BuildCmd(c, name, cli.WithFlags("--label", "foo", "--label", "bar="),
|
|
| 5072 | 5072 |
build.WithDockerfile(`FROM `+minimalBaseImage()+` |
| 5073 | 5073 |
LABEL foo=from-dockerfile`)) |
| 5074 | 5074 |
res = inspectFieldJSON(c, name, "Config.Labels") |
| ... | ... |
@@ -5081,7 +5081,7 @@ func (s *DockerCLIBuildSuite) TestBuildLabelsOverride(c *testing.T) {
|
| 5081 | 5081 |
// This time is for inherited images |
| 5082 | 5082 |
name = "new2" |
| 5083 | 5083 |
expected = `{"bar":"","foo":""}`
|
| 5084 |
- buildImageSuccessfully(c, name, cli.WithFlags("--label", "foo=", "--label", "bar"),
|
|
| 5084 |
+ cli.BuildCmd(c, name, cli.WithFlags("--label", "foo=", "--label", "bar"),
|
|
| 5085 | 5085 |
build.WithDockerfile(`FROM from |
| 5086 | 5086 |
LABEL bar from-dockerfile2`)) |
| 5087 | 5087 |
res = inspectFieldJSON(c, name, "Config.Labels") |
| ... | ... |
@@ -5092,7 +5092,7 @@ func (s *DockerCLIBuildSuite) TestBuildLabelsOverride(c *testing.T) {
|
| 5092 | 5092 |
// Command line option labels with only `FROM` |
| 5093 | 5093 |
name = "scratchy" |
| 5094 | 5094 |
expected = `{"bar":"from-flag","foo":"from-flag"}`
|
| 5095 |
- buildImageSuccessfully(c, name, cli.WithFlags("--label", "foo=from-flag", "--label", "bar=from-flag"),
|
|
| 5095 |
+ cli.BuildCmd(c, name, cli.WithFlags("--label", "foo=from-flag", "--label", "bar=from-flag"),
|
|
| 5096 | 5096 |
build.WithDockerfile(`FROM `+minimalBaseImage())) |
| 5097 | 5097 |
res = inspectFieldJSON(c, name, "Config.Labels") |
| 5098 | 5098 |
if res != expected {
|
| ... | ... |
@@ -5102,7 +5102,7 @@ func (s *DockerCLIBuildSuite) TestBuildLabelsOverride(c *testing.T) {
|
| 5102 | 5102 |
// Command line option labels with env var |
| 5103 | 5103 |
name = "scratchz" |
| 5104 | 5104 |
expected = `{"bar":"$PATH"}`
|
| 5105 |
- buildImageSuccessfully(c, name, cli.WithFlags("--label", "bar=$PATH"),
|
|
| 5105 |
+ cli.BuildCmd(c, name, cli.WithFlags("--label", "bar=$PATH"),
|
|
| 5106 | 5106 |
build.WithDockerfile(`FROM `+minimalBaseImage())) |
| 5107 | 5107 |
res = inspectFieldJSON(c, name, "Config.Labels") |
| 5108 | 5108 |
if res != expected {
|
| ... | ... |
@@ -5113,7 +5113,7 @@ func (s *DockerCLIBuildSuite) TestBuildLabelsOverride(c *testing.T) {
|
| 5113 | 5113 |
// Test case for #22855 |
| 5114 | 5114 |
func (s *DockerCLIBuildSuite) TestBuildDeleteCommittedFile(c *testing.T) {
|
| 5115 | 5115 |
const name = "test-delete-committed-file" |
| 5116 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 5116 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 5117 | 5117 |
RUN echo test > file |
| 5118 | 5118 |
RUN test -e file |
| 5119 | 5119 |
RUN rm file |
| ... | ... |
@@ -5134,7 +5134,7 @@ func (s *DockerCLIBuildSuite) TestBuildDockerignoreComment(c *testing.T) {
|
| 5134 | 5134 |
RUN sh -c "(ls -la /tmp/#1)" |
| 5135 | 5135 |
RUN sh -c "(! ls -la /tmp/#2)" |
| 5136 | 5136 |
RUN sh -c "(! ls /tmp/foo) && (! ls /tmp/foo2) && (ls /tmp/dir1/foo)"` |
| 5137 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 5137 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 5138 | 5138 |
build.WithFile("Dockerfile", dockerfile),
|
| 5139 | 5139 |
build.WithFile("foo", "foo"),
|
| 5140 | 5140 |
build.WithFile("foo2", "foo2"),
|
| ... | ... |
@@ -5159,7 +5159,7 @@ func (s *DockerCLIBuildSuite) TestBuildWithUTF8BOM(c *testing.T) {
|
| 5159 | 5159 |
const name = "test-with-utf8-bom" |
| 5160 | 5160 |
dockerfile := []byte(`FROM busybox`) |
| 5161 | 5161 |
bomDockerfile := append([]byte{0xEF, 0xBB, 0xBF}, dockerfile...)
|
| 5162 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 5162 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 5163 | 5163 |
build.WithFile("Dockerfile", string(bomDockerfile)),
|
| 5164 | 5164 |
)) |
| 5165 | 5165 |
} |
| ... | ... |
@@ -5175,7 +5175,7 @@ func (s *DockerCLIBuildSuite) TestBuildWithUTF8BOMDockerignore(c *testing.T) {
|
| 5175 | 5175 |
RUN ls /tmp/.dockerignore` |
| 5176 | 5176 |
dockerignore := []byte("./Dockerfile\n")
|
| 5177 | 5177 |
bomDockerignore := append([]byte{0xEF, 0xBB, 0xBF}, dockerignore...)
|
| 5178 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 5178 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 5179 | 5179 |
build.WithFile("Dockerfile", dockerfile),
|
| 5180 | 5180 |
build.WithFile(".dockerignore", string(bomDockerignore)),
|
| 5181 | 5181 |
)) |
| ... | ... |
@@ -5188,7 +5188,7 @@ func (s *DockerCLIBuildSuite) TestBuildShellUpdatesConfig(c *testing.T) {
|
| 5188 | 5188 |
|
| 5189 | 5189 |
const name = "testbuildshellupdatesconfig" |
| 5190 | 5190 |
|
| 5191 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 5191 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 5192 | 5192 |
SHELL ["foo", "-bar"]`)) |
| 5193 | 5193 |
expected := `["foo","-bar","#(nop) ","SHELL [foo -bar]"]` |
| 5194 | 5194 |
res := inspectFieldJSON(c, name, "ContainerConfig.Cmd") |
| ... | ... |
@@ -5241,7 +5241,7 @@ func (s *DockerCLIBuildSuite) TestBuildShellMultiple(c *testing.T) {
|
| 5241 | 5241 |
func (s *DockerCLIBuildSuite) TestBuildShellEntrypoint(c *testing.T) {
|
| 5242 | 5242 |
const name = "testbuildshellentrypoint" |
| 5243 | 5243 |
|
| 5244 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 5244 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 5245 | 5245 |
SHELL ["ls"] |
| 5246 | 5246 |
ENTRYPOINT -l`)) |
| 5247 | 5247 |
// A container started from the image uses the shell-form ENTRYPOINT. |
| ... | ... |
@@ -5255,7 +5255,7 @@ func (s *DockerCLIBuildSuite) TestBuildShellEntrypoint(c *testing.T) {
|
| 5255 | 5255 |
// #22489 Shell test to confirm shell is inherited in a subsequent build |
| 5256 | 5256 |
func (s *DockerCLIBuildSuite) TestBuildShellInherited(c *testing.T) {
|
| 5257 | 5257 |
const name1 = "testbuildshellinherited1" |
| 5258 |
- buildImageSuccessfully(c, name1, build.WithDockerfile(`FROM busybox |
|
| 5258 |
+ cli.BuildCmd(c, name1, build.WithDockerfile(`FROM busybox |
|
| 5259 | 5259 |
SHELL ["ls"]`)) |
| 5260 | 5260 |
const name2 = "testbuildshellinherited2" |
| 5261 | 5261 |
buildImage(name2, build.WithDockerfile(`FROM `+name1+` |
| ... | ... |
@@ -5317,7 +5317,7 @@ func (s *DockerCLIBuildSuite) TestBuildEscapeNotBackslashWordTest(c *testing.T) |
| 5317 | 5317 |
func (s *DockerCLIBuildSuite) TestBuildCmdShellArgsEscaped(c *testing.T) {
|
| 5318 | 5318 |
testRequires(c, DaemonIsWindows) |
| 5319 | 5319 |
const name1 = "testbuildcmdshellescapedshellform" |
| 5320 |
- buildImageSuccessfully(c, name1, build.WithDockerfile(` |
|
| 5320 |
+ cli.BuildCmd(c, name1, build.WithDockerfile(` |
|
| 5321 | 5321 |
FROM `+minimalBaseImage()+` |
| 5322 | 5322 |
CMD "ipconfig" |
| 5323 | 5323 |
`)) |
| ... | ... |
@@ -5335,7 +5335,7 @@ func (s *DockerCLIBuildSuite) TestBuildCmdShellArgsEscaped(c *testing.T) {
|
| 5335 | 5335 |
|
| 5336 | 5336 |
// Now in JSON/exec-form |
| 5337 | 5337 |
const name2 = "testbuildcmdshellescapedexecform" |
| 5338 |
- buildImageSuccessfully(c, name2, build.WithDockerfile(` |
|
| 5338 |
+ cli.BuildCmd(c, name2, build.WithDockerfile(` |
|
| 5339 | 5339 |
FROM `+minimalBaseImage()+` |
| 5340 | 5340 |
CMD ["ipconfig"] |
| 5341 | 5341 |
`)) |
| ... | ... |
@@ -5558,7 +5558,7 @@ func (s *DockerCLIBuildSuite) TestBuildNetContainer(c *testing.T) {
|
| 5558 | 5558 |
id := cli.DockerCmd(c, "run", "--hostname", "foobar", "-d", "busybox", "nc", "-ll", "-p", "1234", "-e", "hostname").Stdout() |
| 5559 | 5559 |
|
| 5560 | 5560 |
const name = "testbuildnetcontainer" |
| 5561 |
- buildImageSuccessfully(c, name, cli.WithFlags("--network=container:"+strings.TrimSpace(id)),
|
|
| 5561 |
+ cli.BuildCmd(c, name, cli.WithFlags("--network=container:"+strings.TrimSpace(id)),
|
|
| 5562 | 5562 |
build.WithDockerfile(` |
| 5563 | 5563 |
FROM busybox |
| 5564 | 5564 |
RUN nc localhost 1234 > /otherhost |
| ... | ... |
@@ -5572,7 +5572,7 @@ func (s *DockerCLIBuildSuite) TestBuildWithExtraHost(c *testing.T) {
|
| 5572 | 5572 |
testRequires(c, DaemonIsLinux) |
| 5573 | 5573 |
|
| 5574 | 5574 |
const name = "testbuildwithextrahost" |
| 5575 |
- buildImageSuccessfully(c, name, |
|
| 5575 |
+ cli.BuildCmd(c, name, |
|
| 5576 | 5576 |
cli.WithFlags( |
| 5577 | 5577 |
"--add-host", "foo:127.0.0.1", |
| 5578 | 5578 |
"--add-host", "bar:127.0.0.1", |
| ... | ... |
@@ -5984,7 +5984,7 @@ func (s *DockerCLIBuildSuite) TestBuildOpaqueDirectory(c *testing.T) {
|
| 5984 | 5984 |
` |
| 5985 | 5985 |
// Test that build succeeds, last command fails if opaque directory |
| 5986 | 5986 |
// was not handled correctly |
| 5987 |
- buildImageSuccessfully(c, "testopaquedirectory", build.WithDockerfile(dockerFile)) |
|
| 5987 |
+ cli.BuildCmd(c, "testopaquedirectory", build.WithDockerfile(dockerFile)) |
|
| 5988 | 5988 |
} |
| 5989 | 5989 |
|
| 5990 | 5990 |
// Windows test for USER in dockerfile |
| ... | ... |
@@ -6008,7 +6008,7 @@ func (s *DockerCLIBuildSuite) TestBuildWindowsUser(c *testing.T) {
|
| 6008 | 6008 |
// Note 27545 was reverted in 28505, but a new fix was added subsequently in 28514. |
| 6009 | 6009 |
func (s *DockerCLIBuildSuite) TestBuildCopyFileDotWithWorkdir(c *testing.T) {
|
| 6010 | 6010 |
const name = "testbuildcopyfiledotwithworkdir" |
| 6011 |
- buildImageSuccessfully(c, name, build.WithBuildContext(c, |
|
| 6011 |
+ cli.BuildCmd(c, name, build.WithBuildContext(c, |
|
| 6012 | 6012 |
build.WithFile("Dockerfile", `FROM busybox
|
| 6013 | 6013 |
WORKDIR /foo |
| 6014 | 6014 |
COPY file . |
| ... | ... |
@@ -6022,7 +6022,7 @@ RUN ["cat", "/foo/file"] |
| 6022 | 6022 |
func (s *DockerCLIBuildSuite) TestBuildWindowsEnvCaseInsensitive(c *testing.T) {
|
| 6023 | 6023 |
testRequires(c, DaemonIsWindows) |
| 6024 | 6024 |
const name = "testbuildwindowsenvcaseinsensitive" |
| 6025 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 6025 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 6026 | 6026 |
FROM `+testEnv.PlatformDefaults.BaseImage+` |
| 6027 | 6027 |
ENV FOO=bar foo=baz |
| 6028 | 6028 |
`)) |
| ... | ... |
@@ -6035,7 +6035,7 @@ func (s *DockerCLIBuildSuite) TestBuildWindowsEnvCaseInsensitive(c *testing.T) {
|
| 6035 | 6035 |
// Test case for 29667 |
| 6036 | 6036 |
func (s *DockerCLIBuildSuite) TestBuildWorkdirImageCmd(c *testing.T) {
|
| 6037 | 6037 |
imgName := "testworkdirimagecmd" |
| 6038 |
- buildImageSuccessfully(c, imgName, build.WithDockerfile(` |
|
| 6038 |
+ cli.BuildCmd(c, imgName, build.WithDockerfile(` |
|
| 6039 | 6039 |
FROM busybox |
| 6040 | 6040 |
WORKDIR /foo/bar |
| 6041 | 6041 |
`)) |
| ... | ... |
@@ -6043,7 +6043,7 @@ WORKDIR /foo/bar |
| 6043 | 6043 |
assert.Equal(c, strings.TrimSpace(out), `["sh"]`) |
| 6044 | 6044 |
|
| 6045 | 6045 |
imgName = "testworkdirlabelimagecmd" |
| 6046 |
- buildImageSuccessfully(c, imgName, build.WithDockerfile(` |
|
| 6046 |
+ cli.BuildCmd(c, imgName, build.WithDockerfile(` |
|
| 6047 | 6047 |
FROM busybox |
| 6048 | 6048 |
WORKDIR /foo/bar |
| 6049 | 6049 |
LABEL a=b |
| ... | ... |
@@ -6061,7 +6061,7 @@ func (s *DockerCLIBuildSuite) TestBuildWorkdirCmd(c *testing.T) {
|
| 6061 | 6061 |
FROM busybox |
| 6062 | 6062 |
WORKDIR / |
| 6063 | 6063 |
` |
| 6064 |
- buildImageSuccessfully(c, name, build.WithDockerfile(dockerFile)) |
|
| 6064 |
+ cli.BuildCmd(c, name, build.WithDockerfile(dockerFile)) |
|
| 6065 | 6065 |
result := buildImage(name, build.WithDockerfile(dockerFile)) |
| 6066 | 6066 |
result.Assert(c, icmd.Success) |
| 6067 | 6067 |
assert.Equal(c, strings.Count(result.Combined(), "Using cache"), 1) |
| ... | ... |
@@ -6125,11 +6125,11 @@ func (s *DockerCLIBuildSuite) TestBuildLineErrorWithComments(c *testing.T) {
|
| 6125 | 6125 |
|
| 6126 | 6126 |
// #31957 |
| 6127 | 6127 |
func (s *DockerCLIBuildSuite) TestBuildSetCommandWithDefinedShell(c *testing.T) {
|
| 6128 |
- buildImageSuccessfully(c, "build1", build.WithDockerfile(` |
|
| 6128 |
+ cli.BuildCmd(c, "build1", build.WithDockerfile(` |
|
| 6129 | 6129 |
FROM busybox |
| 6130 | 6130 |
SHELL ["/bin/sh", "-c"] |
| 6131 | 6131 |
`)) |
| 6132 |
- buildImageSuccessfully(c, "build2", build.WithDockerfile(` |
|
| 6132 |
+ cli.BuildCmd(c, "build2", build.WithDockerfile(` |
|
| 6133 | 6133 |
FROM build1 |
| 6134 | 6134 |
CMD echo foo |
| 6135 | 6135 |
`)) |
| ... | ... |
@@ -115,7 +115,7 @@ func (s *DockerCLIBuildSuite) TestBuildAddChangeOwnership(c *testing.T) {
|
| 115 | 115 |
|
| 116 | 116 |
defer ctx.Close() |
| 117 | 117 |
|
| 118 |
- buildImageSuccessfully(c, name, build.WithExternalBuildContext(ctx)) |
|
| 118 |
+ cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx)) |
|
| 119 | 119 |
} |
| 120 | 120 |
|
| 121 | 121 |
// Test that an infinite sleep during a build is killed if the client disconnects. |
| ... | ... |
@@ -175,7 +175,7 @@ func (s *DockerRegistrySuite) TestBuildByDigest(t *testing.T) {
|
| 175 | 175 |
|
| 176 | 176 |
// do the build |
| 177 | 177 |
const name = "buildbydigest" |
| 178 |
- buildImageSuccessfully(t, name, build.WithDockerfile(fmt.Sprintf( |
|
| 178 |
+ cli.BuildCmd(t, name, build.WithDockerfile(fmt.Sprintf( |
|
| 179 | 179 |
`FROM %s |
| 180 | 180 |
CMD ["/bin/echo", "Hello World"]`, imageReference))) |
| 181 | 181 |
assert.NilError(t, err) |
| ... | ... |
@@ -403,7 +403,7 @@ func (s *DockerRegistrySuite) TestPsListContainersFilterAncestorImageByDigest(t |
| 403 | 403 |
|
| 404 | 404 |
// build an image from it |
| 405 | 405 |
const imageName1 = "images_ps_filter_test" |
| 406 |
- buildImageSuccessfully(t, imageName1, build.WithDockerfile(fmt.Sprintf( |
|
| 406 |
+ cli.BuildCmd(t, imageName1, build.WithDockerfile(fmt.Sprintf( |
|
| 407 | 407 |
`FROM %s |
| 408 | 408 |
LABEL match me 1`, imageReference))) |
| 409 | 409 |
|
| ... | ... |
@@ -178,7 +178,7 @@ func (s *DockerCLICreateSuite) TestCreateLabels(c *testing.T) {
|
| 178 | 178 |
|
| 179 | 179 |
func (s *DockerCLICreateSuite) TestCreateLabelFromImage(c *testing.T) {
|
| 180 | 180 |
imageName := "testcreatebuildlabel" |
| 181 |
- buildImageSuccessfully(c, imageName, build.WithDockerfile(`FROM busybox |
|
| 181 |
+ cli.BuildCmd(c, imageName, build.WithDockerfile(`FROM busybox |
|
| 182 | 182 |
LABEL k1=v1 k2=v2`)) |
| 183 | 183 |
|
| 184 | 184 |
const name = "test_create_labels_from_image" |
| ... | ... |
@@ -337,7 +337,7 @@ func (s *DockerCLIEventSuite) TestEventsFilterImageLabels(c *testing.T) {
|
| 337 | 337 |
label := "io.docker.testing=image" |
| 338 | 338 |
|
| 339 | 339 |
// Build a test image. |
| 340 |
- buildImageSuccessfully(c, name, |
|
| 340 |
+ cli.BuildCmd(c, name, |
|
| 341 | 341 |
build.WithDockerfile("FROM busybox:latest\nLABEL "+label),
|
| 342 | 342 |
build.WithoutCache, // Make sure image is actually built |
| 343 | 343 |
) |
| ... | ... |
@@ -418,7 +418,7 @@ func (s *DockerCLIEventSuite) TestEventsCommit(c *testing.T) {
|
| 418 | 418 |
|
| 419 | 419 |
func (s *DockerCLIEventSuite) TestEventsCopy(c *testing.T) {
|
| 420 | 420 |
// Build a test image. |
| 421 |
- buildImageSuccessfully(c, "cpimg", build.WithDockerfile(` |
|
| 421 |
+ cli.BuildCmd(c, "cpimg", build.WithDockerfile(` |
|
| 422 | 422 |
FROM busybox |
| 423 | 423 |
RUN echo HI > /file`)) |
| 424 | 424 |
id := getIDByName(c, "cpimg") |
| ... | ... |
@@ -560,7 +560,7 @@ func (s *DockerCLIEventSuite) TestEventsFilterType(c *testing.T) {
|
| 560 | 560 |
label := "io.docker.testing=image" |
| 561 | 561 |
|
| 562 | 562 |
// Build a test image. |
| 563 |
- buildImageSuccessfully(c, name, |
|
| 563 |
+ cli.BuildCmd(c, name, |
|
| 564 | 564 |
build.WithDockerfile("FROM busybox:latest\nLABEL "+label),
|
| 565 | 565 |
build.WithoutCache, // Make sure image is actually built |
| 566 | 566 |
) |
| ... | ... |
@@ -312,7 +312,7 @@ func (s *DockerCLIEventSuite) TestEventsImageUntagDelete(c *testing.T) {
|
| 312 | 312 |
defer observer.Stop() |
| 313 | 313 |
|
| 314 | 314 |
name := "testimageevents" |
| 315 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM scratch |
|
| 315 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM scratch |
|
| 316 | 316 |
MAINTAINER "docker"`)) |
| 317 | 317 |
imageID := getIDByName(c, name) |
| 318 | 318 |
assert.NilError(c, deleteImages(name)) |
| ... | ... |
@@ -491,7 +491,7 @@ func (s *DockerCLIExecSuite) TestExecWithImageUser(c *testing.T) {
|
| 491 | 491 |
// Not applicable on Windows |
| 492 | 492 |
testRequires(c, DaemonIsLinux) |
| 493 | 493 |
const name = "testbuilduser" |
| 494 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 494 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 495 | 495 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 496 | 496 |
USER dockerio`)) |
| 497 | 497 |
cli.DockerCmd(c, "run", "-d", "--name", "dockerioexec", name, "top") |
| ... | ... |
@@ -56,7 +56,7 @@ func (s *DockerCLIHealthSuite) TestHealth(c *testing.T) {
|
| 56 | 56 |
existingContainers := ExistingContainerIDs(c) |
| 57 | 57 |
|
| 58 | 58 |
imageName := "testhealth" |
| 59 |
- buildImageSuccessfully(c, imageName, build.WithDockerfile(`FROM busybox |
|
| 59 |
+ cli.BuildCmd(c, imageName, build.WithDockerfile(`FROM busybox |
|
| 60 | 60 |
RUN echo OK > /status |
| 61 | 61 |
CMD ["/bin/sleep", "120"] |
| 62 | 62 |
STOPSIGNAL SIGKILL |
| ... | ... |
@@ -100,7 +100,7 @@ func (s *DockerCLIHealthSuite) TestHealth(c *testing.T) {
|
| 100 | 100 |
cli.DockerCmd(c, "rm", "noh") |
| 101 | 101 |
|
| 102 | 102 |
// Disable the check with a new build |
| 103 |
- buildImageSuccessfully(c, "no_healthcheck", build.WithDockerfile(`FROM testhealth |
|
| 103 |
+ cli.BuildCmd(c, "no_healthcheck", build.WithDockerfile(`FROM testhealth |
|
| 104 | 104 |
HEALTHCHECK NONE`)) |
| 105 | 105 |
|
| 106 | 106 |
out = cli.DockerCmd(c, "inspect", "--format={{.Config.Healthcheck.Test}}", "no_healthcheck").Stdout()
|
| ... | ... |
@@ -144,7 +144,7 @@ func (s *DockerCLIHealthSuite) TestHealth(c *testing.T) {
|
| 144 | 144 |
cli.DockerCmd(c, "rm", "-f", "test") |
| 145 | 145 |
|
| 146 | 146 |
// Check JSON-format |
| 147 |
- buildImageSuccessfully(c, imageName, build.WithDockerfile(`FROM busybox |
|
| 147 |
+ cli.BuildCmd(c, imageName, build.WithDockerfile(`FROM busybox |
|
| 148 | 148 |
RUN echo OK > /status |
| 149 | 149 |
CMD ["/bin/sleep", "120"] |
| 150 | 150 |
STOPSIGNAL SIGKILL |
| ... | ... |
@@ -159,7 +159,7 @@ func (s *DockerCLIHealthSuite) TestUnsetEnvVarHealthCheck(c *testing.T) {
|
| 159 | 159 |
testRequires(c, DaemonIsLinux) // busybox doesn't work on Windows |
| 160 | 160 |
|
| 161 | 161 |
imageName := "testhealth" |
| 162 |
- buildImageSuccessfully(c, imageName, build.WithDockerfile(`FROM busybox |
|
| 162 |
+ cli.BuildCmd(c, imageName, build.WithDockerfile(`FROM busybox |
|
| 163 | 163 |
HEALTHCHECK --interval=1s --timeout=5s --retries=5 CMD /bin/sh -c "sleep 1" |
| 164 | 164 |
ENTRYPOINT /bin/sh -c "sleep 600"`)) |
| 165 | 165 |
|
| ... | ... |
@@ -30,7 +30,7 @@ func (s *DockerCLIHistorySuite) OnTimeout(t *testing.T) {
|
| 30 | 30 |
// sort is not predictable it doesn't always fail. |
| 31 | 31 |
func (s *DockerCLIHistorySuite) TestBuildHistory(c *testing.T) {
|
| 32 | 32 |
const name = "testbuildhistory" |
| 33 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 33 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 34 | 34 |
LABEL label.A="A" |
| 35 | 35 |
LABEL label.B="B" |
| 36 | 36 |
LABEL label.C="C" |
| ... | ... |
@@ -60,15 +60,15 @@ func (s *DockerCLIImagesSuite) TestImagesEnsureImageWithBadTagIsNotListed(c *tes |
| 60 | 60 |
} |
| 61 | 61 |
|
| 62 | 62 |
func (s *DockerCLIImagesSuite) TestImagesOrderedByCreationDate(c *testing.T) {
|
| 63 |
- buildImageSuccessfully(c, "order:test_a", build.WithDockerfile(`FROM busybox |
|
| 63 |
+ cli.BuildCmd(c, "order:test_a", build.WithDockerfile(`FROM busybox |
|
| 64 | 64 |
MAINTAINER dockerio1`)) |
| 65 | 65 |
id1 := getIDByName(c, "order:test_a") |
| 66 | 66 |
time.Sleep(1 * time.Second) |
| 67 |
- buildImageSuccessfully(c, "order:test_c", build.WithDockerfile(`FROM busybox |
|
| 67 |
+ cli.BuildCmd(c, "order:test_c", build.WithDockerfile(`FROM busybox |
|
| 68 | 68 |
MAINTAINER dockerio2`)) |
| 69 | 69 |
id2 := getIDByName(c, "order:test_c") |
| 70 | 70 |
time.Sleep(1 * time.Second) |
| 71 |
- buildImageSuccessfully(c, "order:test_b", build.WithDockerfile(`FROM busybox |
|
| 71 |
+ cli.BuildCmd(c, "order:test_b", build.WithDockerfile(`FROM busybox |
|
| 72 | 72 |
MAINTAINER dockerio3`)) |
| 73 | 73 |
id3 := getIDByName(c, "order:test_b") |
| 74 | 74 |
|
| ... | ... |
@@ -89,15 +89,15 @@ func (s *DockerCLIImagesSuite) TestImagesFilterLabelMatch(c *testing.T) {
|
| 89 | 89 |
const imageName1 = "images_filter_test1" |
| 90 | 90 |
const imageName2 = "images_filter_test2" |
| 91 | 91 |
const imageName3 = "images_filter_test3" |
| 92 |
- buildImageSuccessfully(c, imageName1, build.WithDockerfile(`FROM busybox |
|
| 92 |
+ cli.BuildCmd(c, imageName1, build.WithDockerfile(`FROM busybox |
|
| 93 | 93 |
LABEL match me`)) |
| 94 | 94 |
image1ID := getIDByName(c, imageName1) |
| 95 | 95 |
|
| 96 |
- buildImageSuccessfully(c, imageName2, build.WithDockerfile(`FROM busybox |
|
| 96 |
+ cli.BuildCmd(c, imageName2, build.WithDockerfile(`FROM busybox |
|
| 97 | 97 |
LABEL match="me too"`)) |
| 98 | 98 |
image2ID := getIDByName(c, imageName2) |
| 99 | 99 |
|
| 100 |
- buildImageSuccessfully(c, imageName3, build.WithDockerfile(`FROM busybox |
|
| 100 |
+ cli.BuildCmd(c, imageName3, build.WithDockerfile(`FROM busybox |
|
| 101 | 101 |
LABEL nomatch me`)) |
| 102 | 102 |
image3ID := getIDByName(c, imageName3) |
| 103 | 103 |
|
| ... | ... |
@@ -128,13 +128,13 @@ func (s *DockerCLIImagesSuite) TestCommitWithFilterLabel(c *testing.T) {
|
| 128 | 128 |
} |
| 129 | 129 |
|
| 130 | 130 |
func (s *DockerCLIImagesSuite) TestImagesFilterSinceAndBefore(c *testing.T) {
|
| 131 |
- buildImageSuccessfully(c, "image:1", build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 131 |
+ cli.BuildCmd(c, "image:1", build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 132 | 132 |
LABEL number=1`)) |
| 133 | 133 |
imageID1 := getIDByName(c, "image:1") |
| 134 |
- buildImageSuccessfully(c, "image:2", build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 134 |
+ cli.BuildCmd(c, "image:2", build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 135 | 135 |
LABEL number=2`)) |
| 136 | 136 |
imageID2 := getIDByName(c, "image:2") |
| 137 |
- buildImageSuccessfully(c, "image:3", build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 137 |
+ cli.BuildCmd(c, "image:3", build.WithDockerfile(`FROM `+minimalBaseImage()+` |
|
| 138 | 138 |
LABEL number=3`)) |
| 139 | 139 |
imageID3 := getIDByName(c, "image:3") |
| 140 | 140 |
|
| ... | ... |
@@ -299,7 +299,7 @@ func (s *DockerCLIImagesSuite) TestImagesEnsureImagesFromScratchShown(c *testing |
| 299 | 299 |
MAINTAINER docker` |
| 300 | 300 |
|
| 301 | 301 |
const name = "scratch-image" |
| 302 |
- buildImageSuccessfully(c, name, build.WithDockerfile(dockerfile)) |
|
| 302 |
+ cli.BuildCmd(c, name, build.WithDockerfile(dockerfile)) |
|
| 303 | 303 |
id := getIDByName(c, name) |
| 304 | 304 |
|
| 305 | 305 |
out := cli.DockerCmd(c, "images").Stdout() |
| ... | ... |
@@ -315,7 +315,7 @@ func (s *DockerCLIImagesSuite) TestImagesEnsureImagesFromBusyboxShown(c *testing |
| 315 | 315 |
MAINTAINER docker` |
| 316 | 316 |
const name = "busybox-image" |
| 317 | 317 |
|
| 318 |
- buildImageSuccessfully(c, name, build.WithDockerfile(dockerfile)) |
|
| 318 |
+ cli.BuildCmd(c, name, build.WithDockerfile(dockerfile)) |
|
| 319 | 319 |
id := getIDByName(c, name) |
| 320 | 320 |
|
| 321 | 321 |
out := cli.DockerCmd(c, "images").Stdout() |
| ... | ... |
@@ -323,17 +323,17 @@ func (s *DockerCLIPsSuite) TestPsListContainersFilterAncestorImage(c *testing.T) |
| 323 | 323 |
|
| 324 | 324 |
// Build images |
| 325 | 325 |
imageName1 := "images_ps_filter_test1" |
| 326 |
- buildImageSuccessfully(c, imageName1, build.WithDockerfile(`FROM busybox |
|
| 326 |
+ cli.BuildCmd(c, imageName1, build.WithDockerfile(`FROM busybox |
|
| 327 | 327 |
LABEL match me 1`)) |
| 328 | 328 |
imageID1 := getIDByName(c, imageName1) |
| 329 | 329 |
|
| 330 | 330 |
imageName1Tagged := "images_ps_filter_test1:tag" |
| 331 |
- buildImageSuccessfully(c, imageName1Tagged, build.WithDockerfile(`FROM busybox |
|
| 331 |
+ cli.BuildCmd(c, imageName1Tagged, build.WithDockerfile(`FROM busybox |
|
| 332 | 332 |
LABEL match me 1 tagged`)) |
| 333 | 333 |
imageID1Tagged := getIDByName(c, imageName1Tagged) |
| 334 | 334 |
|
| 335 | 335 |
imageName2 := "images_ps_filter_test2" |
| 336 |
- buildImageSuccessfully(c, imageName2, build.WithDockerfile(fmt.Sprintf(`FROM %s |
|
| 336 |
+ cli.BuildCmd(c, imageName2, build.WithDockerfile(fmt.Sprintf(`FROM %s |
|
| 337 | 337 |
LABEL match me 2`, imageName1))) |
| 338 | 338 |
imageID2 := getIDByName(c, imageName2) |
| 339 | 339 |
|
| ... | ... |
@@ -58,7 +58,7 @@ func (s *DockerRegistrySuite) TestConcurrentPullWholeRepo(t *testing.T) {
|
| 58 | 58 |
var repos []string |
| 59 | 59 |
for _, tag := range []string{"recent", "fresh", "todays"} {
|
| 60 | 60 |
repo := fmt.Sprintf("%v:%v", imgRepo, tag)
|
| 61 |
- buildImageSuccessfully(t, repo, build.WithDockerfile(fmt.Sprintf(` |
|
| 61 |
+ cli.BuildCmd(t, repo, build.WithDockerfile(fmt.Sprintf(` |
|
| 62 | 62 |
FROM busybox |
| 63 | 63 |
ENTRYPOINT ["/bin/echo"] |
| 64 | 64 |
ENV FOO foo |
| ... | ... |
@@ -130,7 +130,7 @@ func (s *DockerRegistrySuite) TestConcurrentPullMultipleTags(t *testing.T) {
|
| 130 | 130 |
var repos []string |
| 131 | 131 |
for _, tag := range []string{"recent", "fresh", "todays"} {
|
| 132 | 132 |
repo := fmt.Sprintf("%v:%v", imgRepo, tag)
|
| 133 |
- buildImageSuccessfully(t, repo, build.WithDockerfile(fmt.Sprintf(` |
|
| 133 |
+ cli.BuildCmd(t, repo, build.WithDockerfile(fmt.Sprintf(` |
|
| 134 | 134 |
FROM busybox |
| 135 | 135 |
ENTRYPOINT ["/bin/echo"] |
| 136 | 136 |
ENV FOO foo |
| ... | ... |
@@ -176,7 +176,7 @@ func (s *DockerRegistrySuite) TestPullIDStability(t *testing.T) {
|
| 176 | 176 |
const derivedImage = privateRegistryURL + "/dockercli/id-stability" |
| 177 | 177 |
const baseImage = "busybox" |
| 178 | 178 |
|
| 179 |
- buildImageSuccessfully(t, derivedImage, build.WithDockerfile(fmt.Sprintf(` |
|
| 179 |
+ cli.BuildCmd(t, derivedImage, build.WithDockerfile(fmt.Sprintf(` |
|
| 180 | 180 |
FROM %s |
| 181 | 181 |
ENV derived true |
| 182 | 182 |
ENV asdf true |
| ... | ... |
@@ -226,7 +226,7 @@ func (s *DockerRegistrySuite) TestPullIDStability(t *testing.T) {
|
| 226 | 226 |
func (s *DockerRegistrySuite) TestPullNoLayers(t *testing.T) {
|
| 227 | 227 |
const imgRepo = privateRegistryURL + "/dockercli/scratch" |
| 228 | 228 |
|
| 229 |
- buildImageSuccessfully(t, imgRepo, build.WithDockerfile(` |
|
| 229 |
+ cli.BuildCmd(t, imgRepo, build.WithDockerfile(` |
|
| 230 | 230 |
FROM scratch |
| 231 | 231 |
ENV foo bar`)) |
| 232 | 232 |
cli.DockerCmd(t, "push", imgRepo) |
| ... | ... |
@@ -135,7 +135,7 @@ func (s *DockerRegistrySuite) TestConcurrentPush(c *testing.T) {
|
| 135 | 135 |
var repos []string |
| 136 | 136 |
for _, tag := range []string{"push1", "push2", "push3"} {
|
| 137 | 137 |
repo := fmt.Sprintf("%v:%v", imgRepo, tag)
|
| 138 |
- buildImageSuccessfully(c, repo, build.WithDockerfile(fmt.Sprintf("FROM busybox\nCMD echo hello from %s\n", repo)))
|
|
| 138 |
+ cli.BuildCmd(c, repo, build.WithDockerfile(fmt.Sprintf("FROM busybox\nCMD echo hello from %s\n", repo)))
|
|
| 139 | 139 |
repos = append(repos, repo) |
| 140 | 140 |
} |
| 141 | 141 |
|
| ... | ... |
@@ -154,7 +154,7 @@ func (s *DockerCLIRmiSuite) TestRmiImgIDForce(c *testing.T) {
|
| 154 | 154 |
// See https://github.com/moby/moby/issues/14116 |
| 155 | 155 |
func (s *DockerCLIRmiSuite) TestRmiImageIDForceWithRunningContainersAndMultipleTags(c *testing.T) {
|
| 156 | 156 |
dockerfile := "FROM busybox\nRUN echo test 14116\n" |
| 157 |
- buildImageSuccessfully(c, "test-14116", build.WithDockerfile(dockerfile)) |
|
| 157 |
+ cli.BuildCmd(c, "test-14116", build.WithDockerfile(dockerfile)) |
|
| 158 | 158 |
imgID := getIDByName(c, "test-14116") |
| 159 | 159 |
|
| 160 | 160 |
newTag := "newtag" |
| ... | ... |
@@ -212,7 +212,7 @@ func (s *DockerCLIRmiSuite) TestRmiForceWithMultipleRepositories(c *testing.T) {
|
| 212 | 212 |
tag1 := imageName + ":tag1" |
| 213 | 213 |
tag2 := imageName + ":tag2" |
| 214 | 214 |
|
| 215 |
- buildImageSuccessfully(c, tag1, build.WithDockerfile(`FROM busybox |
|
| 215 |
+ cli.BuildCmd(c, tag1, build.WithDockerfile(`FROM busybox |
|
| 216 | 216 |
MAINTAINER "docker"`)) |
| 217 | 217 |
cli.DockerCmd(c, "tag", tag1, tag2) |
| 218 | 218 |
|
| ... | ... |
@@ -240,7 +240,7 @@ func (s *DockerCLIRmiSuite) TestRmiContainerImageNotFound(c *testing.T) {
|
| 240 | 240 |
imageIds := make([]string, 2) |
| 241 | 241 |
for i, name := range imageNames {
|
| 242 | 242 |
dockerfile := fmt.Sprintf("FROM busybox\nMAINTAINER %s\nRUN echo %s\n", name, name)
|
| 243 |
- buildImageSuccessfully(c, name, build.WithoutCache, build.WithDockerfile(dockerfile)) |
|
| 243 |
+ cli.BuildCmd(c, name, build.WithoutCache, build.WithDockerfile(dockerfile)) |
|
| 244 | 244 |
id := getIDByName(c, name) |
| 245 | 245 |
imageIds[i] = id |
| 246 | 246 |
} |
| ... | ... |
@@ -269,7 +269,7 @@ RUN echo 0 #layer0 |
| 269 | 269 |
RUN echo 1 #layer1 |
| 270 | 270 |
RUN echo 2 #layer2 |
| 271 | 271 |
` |
| 272 |
- buildImageSuccessfully(c, imgName, build.WithoutCache, build.WithDockerfile(dockerfile)) |
|
| 272 |
+ cli.BuildCmd(c, imgName, build.WithoutCache, build.WithDockerfile(dockerfile)) |
|
| 273 | 273 |
out := cli.DockerCmd(c, "history", "-q", imgName).Stdout() |
| 274 | 274 |
ids := strings.Split(out, "\n") |
| 275 | 275 |
idToTag := ids[2] |
| ... | ... |
@@ -306,7 +306,7 @@ RUN echo 2 #layer2 |
| 306 | 306 |
func (*DockerCLIRmiSuite) TestRmiParentImageFail(c *testing.T) {
|
| 307 | 307 |
skip.If(c, testEnv.UsingSnapshotter(), "image are independent when using the containerd image store") |
| 308 | 308 |
|
| 309 |
- buildImageSuccessfully(c, "test", build.WithDockerfile(` |
|
| 309 |
+ cli.BuildCmd(c, "test", build.WithDockerfile(` |
|
| 310 | 310 |
FROM busybox |
| 311 | 311 |
RUN echo hello`)) |
| 312 | 312 |
|
| ... | ... |
@@ -412,7 +412,7 @@ func (s *DockerCLIRunSuite) TestRunCreateVolumesInSymlinkDir(c *testing.T) {
|
| 412 | 412 |
containerPath = "/test/test" |
| 413 | 413 |
cmd = "true" |
| 414 | 414 |
} |
| 415 |
- buildImageSuccessfully(c, name, build.WithDockerfile(dockerFile)) |
|
| 415 |
+ cli.BuildCmd(c, name, build.WithDockerfile(dockerFile)) |
|
| 416 | 416 |
cli.DockerCmd(c, "run", "-v", containerPath, name, cmd) |
| 417 | 417 |
} |
| 418 | 418 |
|
| ... | ... |
@@ -437,7 +437,7 @@ func (s *DockerCLIRunSuite) TestRunCreateVolumesInSymlinkDir2(c *testing.T) {
|
| 437 | 437 |
containerPath = "/test/test" |
| 438 | 438 |
cmd = "true" |
| 439 | 439 |
} |
| 440 |
- buildImageSuccessfully(c, name, build.WithDockerfile(dockerFile)) |
|
| 440 |
+ cli.BuildCmd(c, name, build.WithDockerfile(dockerFile)) |
|
| 441 | 441 |
cli.DockerCmd(c, "run", "-v", containerPath, name, cmd) |
| 442 | 442 |
} |
| 443 | 443 |
|
| ... | ... |
@@ -1582,7 +1582,7 @@ func (s *DockerCLIRunSuite) TestRunCopyVolumeUIDGID(c *testing.T) {
|
| 1582 | 1582 |
// Not applicable on Windows as it does not support uid or gid in this way |
| 1583 | 1583 |
testRequires(c, DaemonIsLinux) |
| 1584 | 1584 |
name := "testrunvolumesuidgid" |
| 1585 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 1585 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 1586 | 1586 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 1587 | 1587 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| 1588 | 1588 |
RUN mkdir -p /hello && touch /hello/test && chown dockerio.dockerio /hello`)) |
| ... | ... |
@@ -1601,7 +1601,7 @@ func (s *DockerCLIRunSuite) TestRunCopyVolumeContent(c *testing.T) {
|
| 1601 | 1601 |
// that copies from the image to the volume. |
| 1602 | 1602 |
testRequires(c, DaemonIsLinux) |
| 1603 | 1603 |
name := "testruncopyvolumecontent" |
| 1604 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 1604 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 1605 | 1605 |
RUN mkdir -p /hello/local && echo hello > /hello/local/world`)) |
| 1606 | 1606 |
|
| 1607 | 1607 |
// Test that the content is copied from the image to the volume |
| ... | ... |
@@ -1613,7 +1613,7 @@ func (s *DockerCLIRunSuite) TestRunCopyVolumeContent(c *testing.T) {
|
| 1613 | 1613 |
|
| 1614 | 1614 |
func (s *DockerCLIRunSuite) TestRunCleanupCmdOnEntrypoint(c *testing.T) {
|
| 1615 | 1615 |
name := "testrunmdcleanuponentrypoint" |
| 1616 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 1616 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 1617 | 1617 |
ENTRYPOINT ["echo"] |
| 1618 | 1618 |
CMD ["testingpoint"]`)) |
| 1619 | 1619 |
|
| ... | ... |
@@ -2073,7 +2073,7 @@ func (s *DockerCLIRunSuite) TestVolumesNoCopyData(c *testing.T) {
|
| 2073 | 2073 |
// are pre-populated such as is built in the dockerfile used in this test. |
| 2074 | 2074 |
testRequires(c, DaemonIsLinux) |
| 2075 | 2075 |
prefix, slash := getPrefixAndSlashFromDaemonPlatform() |
| 2076 |
- buildImageSuccessfully(c, "dataimage", build.WithDockerfile(`FROM busybox |
|
| 2076 |
+ cli.BuildCmd(c, "dataimage", build.WithDockerfile(`FROM busybox |
|
| 2077 | 2077 |
RUN ["mkdir", "-p", "/foo"] |
| 2078 | 2078 |
RUN ["touch", "/foo/bar"]`)) |
| 2079 | 2079 |
cli.DockerCmd(c, "run", "--name", "test", "-v", prefix+slash+"foo", "busybox") |
| ... | ... |
@@ -2104,7 +2104,7 @@ func (s *DockerCLIRunSuite) TestRunNoOutputFromPullInStdout(c *testing.T) {
|
| 2104 | 2104 |
func (s *DockerCLIRunSuite) TestRunVolumesCleanPaths(c *testing.T) {
|
| 2105 | 2105 |
testRequires(c, testEnv.IsLocalDaemon) |
| 2106 | 2106 |
prefix, slash := getPrefixAndSlashFromDaemonPlatform() |
| 2107 |
- buildImageSuccessfully(c, "run_volumes_clean_paths", build.WithDockerfile(`FROM busybox |
|
| 2107 |
+ cli.BuildCmd(c, "run_volumes_clean_paths", build.WithDockerfile(`FROM busybox |
|
| 2108 | 2108 |
VOLUME `+prefix+`/foo/`)) |
| 2109 | 2109 |
cli.DockerCmd(c, "run", "-v", prefix+"/foo", "-v", prefix+"/bar/", "--name", "dark_helmet", "run_volumes_clean_paths") |
| 2110 | 2110 |
|
| ... | ... |
@@ -3599,7 +3599,7 @@ func (s *DockerCLIRunSuite) TestRunInitLayerPathOwnership(c *testing.T) {
|
| 3599 | 3599 |
// Not applicable on Windows as it does not support Linux uid/gid ownership |
| 3600 | 3600 |
testRequires(c, DaemonIsLinux) |
| 3601 | 3601 |
name := "testetcfileownership" |
| 3602 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 3602 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 3603 | 3603 |
RUN echo 'dockerio:x:1001:1001::/bin:/bin/false' >> /etc/passwd |
| 3604 | 3604 |
RUN echo 'dockerio:x:1001:' >> /etc/group |
| 3605 | 3605 |
RUN chown dockerio:dockerio /etc`)) |
| ... | ... |
@@ -3651,7 +3651,7 @@ func (s *DockerCLIRunSuite) TestRunNamedVolumeCopyImageData(c *testing.T) {
|
| 3651 | 3651 |
testRequires(c, DaemonIsLinux) |
| 3652 | 3652 |
|
| 3653 | 3653 |
testImg := "testvolumecopy" |
| 3654 |
- buildImageSuccessfully(c, testImg, build.WithDockerfile(` |
|
| 3654 |
+ cli.BuildCmd(c, testImg, build.WithDockerfile(` |
|
| 3655 | 3655 |
FROM busybox |
| 3656 | 3656 |
RUN mkdir -p /foo && echo hello > /foo/hello |
| 3657 | 3657 |
`)) |
| ... | ... |
@@ -3770,7 +3770,7 @@ func (s *DockerCLIRunSuite) TestRunVolumeWithOneCharacter(c *testing.T) {
|
| 3770 | 3770 |
|
| 3771 | 3771 |
func (s *DockerCLIRunSuite) TestRunVolumeCopyFlag(c *testing.T) {
|
| 3772 | 3772 |
testRequires(c, DaemonIsLinux) // Windows does not support copying data from image to the volume |
| 3773 |
- buildImageSuccessfully(c, "volumecopy", build.WithDockerfile(`FROM busybox |
|
| 3773 |
+ cli.BuildCmd(c, "volumecopy", build.WithDockerfile(`FROM busybox |
|
| 3774 | 3774 |
RUN mkdir /foo && echo hello > /foo/bar |
| 3775 | 3775 |
CMD cat /foo/bar`)) |
| 3776 | 3776 |
cli.DockerCmd(c, "volume", "create", "test") |
| ... | ... |
@@ -794,7 +794,7 @@ func (s *DockerCLIRunSuite) TestRunTmpfsMounts(c *testing.T) {
|
| 794 | 794 |
|
| 795 | 795 |
func (s *DockerCLIRunSuite) TestRunTmpfsMountsOverrideImageVolumes(c *testing.T) {
|
| 796 | 796 |
const name = "img-with-volumes" |
| 797 |
- buildImageSuccessfully(c, name, build.WithDockerfile(` |
|
| 797 |
+ cli.BuildCmd(c, name, build.WithDockerfile(` |
|
| 798 | 798 |
FROM busybox |
| 799 | 799 |
VOLUME /run |
| 800 | 800 |
RUN touch /run/stuff |
| ... | ... |
@@ -300,7 +300,7 @@ func (s *DockerCLISaveLoadSuite) TestSaveLoadNoTag(c *testing.T) {
|
| 300 | 300 |
|
| 301 | 301 |
name := "saveloadnotag" |
| 302 | 302 |
|
| 303 |
- buildImageSuccessfully(c, name, build.WithDockerfile("FROM busybox\nENV foo=bar"))
|
|
| 303 |
+ cli.BuildCmd(c, name, build.WithDockerfile("FROM busybox\nENV foo=bar"))
|
|
| 304 | 304 |
id := inspectField(c, name, "Id") |
| 305 | 305 |
|
| 306 | 306 |
// Test to make sure that save w/o name just shows imageID during load |
| ... | ... |
@@ -78,7 +78,7 @@ func (s *DockerCLISaveLoadSuite) TestSaveAndLoadWithProgressBar(c *testing.T) {
|
| 78 | 78 |
skip.If(c, testEnv.UsingSnapshotter(), "TODO: Not implemented yet") |
| 79 | 79 |
|
| 80 | 80 |
name := "test-load" |
| 81 |
- buildImageSuccessfully(c, name, build.WithDockerfile(`FROM busybox |
|
| 81 |
+ cli.BuildCmd(c, name, build.WithDockerfile(`FROM busybox |
|
| 82 | 82 |
RUN touch aa |
| 83 | 83 |
`)) |
| 84 | 84 |
|
| ... | ... |
@@ -471,7 +471,7 @@ func (s *DockerCLIVolumeSuite) TestDuplicateMountpointsForVolumesFrom(c *testing |
| 471 | 471 |
testRequires(c, DaemonIsLinux) |
| 472 | 472 |
|
| 473 | 473 |
const imgName = "vimage" |
| 474 |
- buildImageSuccessfully(c, imgName, build.WithDockerfile(` |
|
| 474 |
+ cli.BuildCmd(c, imgName, build.WithDockerfile(` |
|
| 475 | 475 |
FROM busybox |
| 476 | 476 |
VOLUME ["/tmp/data"]`)) |
| 477 | 477 |
|
| ... | ... |
@@ -512,7 +512,7 @@ func (s *DockerCLIVolumeSuite) TestDuplicateMountpointsForVolumesFromAndBind(c * |
| 512 | 512 |
testRequires(c, DaemonIsLinux) |
| 513 | 513 |
|
| 514 | 514 |
const imgName = "vimage" |
| 515 |
- buildImageSuccessfully(c, imgName, build.WithDockerfile(` |
|
| 515 |
+ cli.BuildCmd(c, imgName, build.WithDockerfile(` |
|
| 516 | 516 |
FROM busybox |
| 517 | 517 |
VOLUME ["/tmp/data"]`)) |
| 518 | 518 |
|
| ... | ... |
@@ -554,7 +554,7 @@ func (s *DockerCLIVolumeSuite) TestDuplicateMountpointsForVolumesFromAndMounts(c |
| 554 | 554 |
testRequires(c, testEnv.IsLocalDaemon, DaemonIsLinux) |
| 555 | 555 |
|
| 556 | 556 |
const imgName = "vimage" |
| 557 |
- buildImageSuccessfully(c, imgName, build.WithDockerfile(` |
|
| 557 |
+ cli.BuildCmd(c, imgName, build.WithDockerfile(` |
|
| 558 | 558 |
FROM busybox |
| 559 | 559 |
VOLUME ["/tmp/data"]`)) |
| 560 | 560 |
|
| ... | ... |
@@ -133,12 +133,6 @@ func getIDByName(t *testing.T, name string) string {
|
| 133 | 133 |
} |
| 134 | 134 |
|
| 135 | 135 |
// Deprecated: use cli.Docker |
| 136 |
-func buildImageSuccessfully(t *testing.T, name string, cmdOperators ...cli.CmdOperator) {
|
|
| 137 |
- t.Helper() |
|
| 138 |
- cli.Docker(cli.Args("build", "-t", name), cmdOperators...).Assert(t, icmd.Success)
|
|
| 139 |
-} |
|
| 140 |
- |
|
| 141 |
-// Deprecated: use cli.Docker |
|
| 142 | 136 |
func buildImage(name string, cmdOperators ...cli.CmdOperator) *icmd.Result {
|
| 143 | 137 |
return cli.Docker(cli.Args("build", "-t", name), cmdOperators...)
|
| 144 | 138 |
} |