Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
| ... | ... |
@@ -810,12 +810,19 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`,
|
| 810 | 810 |
} |
| 811 | 811 |
|
| 812 | 812 |
func TestBuildCopyEtcToRoot(t *testing.T) {
|
| 813 |
- buildDirectory := filepath.Join(workingDirectory, "build_tests", "TestCopy") |
|
| 814 |
- if out, _, err := dockerCmdInDir(t, buildDirectory, "build", "-t", "testcopyimg", "EtcToRoot"); err != nil {
|
|
| 815 |
- t.Fatalf("build failed to complete: %s, %v", out, err)
|
|
| 813 |
+ name := "testcopyetctoroot" |
|
| 814 |
+ defer deleteImages(name) |
|
| 815 |
+ ctx, err := fakeContext(`FROM scratch |
|
| 816 |
+COPY . /`, |
|
| 817 |
+ map[string]string{
|
|
| 818 |
+ "etc/test_file": "test1", |
|
| 819 |
+ }) |
|
| 820 |
+ if err != nil {
|
|
| 821 |
+ t.Fatal(err) |
|
| 822 |
+ } |
|
| 823 |
+ if _, err := buildImageFromContext(name, ctx, true); err != nil {
|
|
| 824 |
+ t.Fatal(err) |
|
| 816 | 825 |
} |
| 817 |
- |
|
| 818 |
- deleteImages("testcopyimg")
|
|
| 819 | 826 |
logDone("build - copy etc directory to root")
|
| 820 | 827 |
} |
| 821 | 828 |
|