Skip to content

Commit bf2b3b4

Browse files
milantracygvisor-bot
authored andcommitted
Use gVisor test alpine image for docker tests.
PiperOrigin-RevId: 776691080
1 parent 075576a commit bf2b3b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/image/image_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ import (
4545
// individual slow-downs (but a huge speed-up in aggregate).
4646
const defaultWait = time.Minute
4747

48+
const testAlpineImage = "gcr.io/gvisor-presubmit/basic/alpine_x86_64:1ce68c8160724eb9"
49+
4850
func TestHelloWorld(t *testing.T) {
4951
ctx := context.Background()
5052
d := dockerutil.MakeContainer(ctx, t)
@@ -544,7 +546,7 @@ func testDockerRun(ctx context.Context, t *testing.T, d *dockerutil.Container, h
544546
if startPrivilegedContainer {
545547
cmd = append(cmd, "--privileged")
546548
}
547-
cmd = append(cmd, "alpine", "sh", "-c", "apk add curl && apk info -d curl")
549+
cmd = append(cmd, testAlpineImage, "sh", "-c", "apk add curl && apk info -d curl")
548550
execProc, err := d.ExecProcess(ctx, dockerutil.ExecOpts{}, cmd...)
549551
if err != nil {
550552
t.Fatalf("docker exec failed: %v", err)
@@ -560,7 +562,7 @@ func testDockerRun(ctx context.Context, t *testing.T, d *dockerutil.Container, h
560562
}
561563

562564
func testDockerBuild(ctx context.Context, t *testing.T, d *dockerutil.Container, hostNetwork bool) {
563-
cmd := []string{"echo", "-e", "FROM alpine:3.19\nRUN apk add git", "|", "docker", "build"}
565+
cmd := []string{"echo", "-e", fmt.Sprintf("FROM %s\nRUN apk add git", testAlpineImage), "|", "docker", "build"}
564566
if hostNetwork {
565567
cmd = append(cmd, "--network", "host")
566568
}

0 commit comments

Comments
 (0)