From ea852019b6020134319dfd53c9338d012628e20b Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 22 Jun 2023 16:04:26 +0200 Subject: [PATCH] frozen images: update to debian:bookworm-slim Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 3bfb6a94206aff348948bba231f12e4af0cda70c) Signed-off-by: Cory Snider --- Dockerfile | 2 +- cli/winresources/README.md | 2 +- contrib/nnp-test/Dockerfile | 2 +- contrib/syscall-test/Dockerfile | 2 +- integration-cli/docker_cli_daemon_test.go | 2 +- .../docker_cli_network_unix_test.go | 2 +- integration-cli/docker_cli_run_test.go | 6 +++--- integration-cli/docker_cli_run_unix_test.go | 18 +++++++++--------- integration-cli/fixtures_linux_daemon_test.go | 8 ++++---- integration/build/build_userns_linux_test.go | 4 ++-- testutil/environment/protect.go | 2 +- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e27e19ebd..7f0cdeb240 100644 --- a/Dockerfile +++ b/Dockerfile @@ -119,7 +119,7 @@ ARG TARGETVARIANT RUN /download-frozen-image-v2.sh /build \ busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \ busybox:glibc@sha256:1f81263701cddf6402afe9f33fca0266d9fff379e59b1748f33d3072da71ee85 \ - debian:bullseye-slim@sha256:dacf278785a4daa9de07596ec739dbc07131e189942772210709c5c0777e8437 \ + debian:bookworm-slim@sha256:2bc5c236e9b262645a323e9088dfa3bb1ecb16cc75811daf40a23a824d665be9 \ hello-world:latest@sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9 \ arm32v7/hello-world:latest@sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1 diff --git a/cli/winresources/README.md b/cli/winresources/README.md index fc748978ca..c1d425d4ff 100644 --- a/cli/winresources/README.md +++ b/cli/winresources/README.md @@ -1,7 +1,7 @@ ## Generate `event_messages.bin` ```console -$ docker run --rm -it -v "$(pwd):/winresources" debian:bullseye bash +$ docker run --rm -it -v "$(pwd):/winresources" debian:bookworm-slim bash root@9ad2260f6ebc:/# apt-get update -y && apt-get install -y binutils-mingw-w64-x86-64 root@9ad2260f6ebc:/# x86_64-w64-mingw32-windmc -v /winresources/event_messages.mc root@9ad2260f6ebc:/# mv MSG00001.bin /winresources/event_messages.bin diff --git a/contrib/nnp-test/Dockerfile b/contrib/nnp-test/Dockerfile index 833c5c76c2..a33229ab85 100644 --- a/contrib/nnp-test/Dockerfile +++ b/contrib/nnp-test/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bullseye-slim +FROM debian:bookworm-slim RUN apt-get update && apt-get install -y gcc libc6-dev --no-install-recommends COPY . /usr/src/ diff --git a/contrib/syscall-test/Dockerfile b/contrib/syscall-test/Dockerfile index 8281a06776..7bcf4c7e37 100644 --- a/contrib/syscall-test/Dockerfile +++ b/contrib/syscall-test/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bullseye-slim +FROM debian:bookworm-slim RUN apt-get update && apt-get install -y gcc libc6-dev --no-install-recommends COPY . /usr/src/ diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index 36e2dbfadf..871e518bc9 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -1736,7 +1736,7 @@ func (s *DockerDaemonSuite) TestDaemonNoSpaceLeftOnDeviceError(c *testing.T) { defer s.d.Stop(c) // pull a repository large enough to overfill the mounted filesystem - pullOut, err := s.d.Cmd("pull", "debian:bullseye-slim") + pullOut, err := s.d.Cmd("pull", "debian:bookworm-slim") assert.Assert(c, err != nil, pullOut) assert.Assert(c, strings.Contains(pullOut, "no space left on device")) } diff --git a/integration-cli/docker_cli_network_unix_test.go b/integration-cli/docker_cli_network_unix_test.go index 15baedf9fc..518d4e14f4 100644 --- a/integration-cli/docker_cli_network_unix_test.go +++ b/integration-cli/docker_cli_network_unix_test.go @@ -1571,7 +1571,7 @@ func (s *DockerCLINetworkSuite) TestEmbeddedDNSInvalidInput(c *testing.T) { dockerCmd(c, "network", "create", "-d", "bridge", "nw1") // Sending garbage to embedded DNS shouldn't crash the daemon - dockerCmd(c, "run", "-i", "--net=nw1", "--name=c1", "debian:bullseye-slim", "bash", "-c", "echo InvalidQuery > /dev/udp/127.0.0.11/53") + dockerCmd(c, "run", "-i", "--net=nw1", "--name=c1", "debian:bookworm-slim", "bash", "-c", "echo InvalidQuery > /dev/udp/127.0.0.11/53") } func (s *DockerCLINetworkSuite) TestDockerNetworkConnectFailsNoInspectChange(c *testing.T) { diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index 9ab6cf4250..b6e0d65df2 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -2913,7 +2913,7 @@ func (s *DockerCLIRunSuite) TestRunUnshareProc(c *testing.T) { go func() { name := "acidburn" - out, _, err := dockerCmdWithError("run", "--name", name, "--security-opt", "seccomp=unconfined", "debian:bullseye-slim", "unshare", "-p", "-m", "-f", "-r", "--mount-proc=/proc", "mount") + out, _, err := dockerCmdWithError("run", "--name", name, "--security-opt", "seccomp=unconfined", "debian:bookworm-slim", "unshare", "-p", "-m", "-f", "-r", "--mount-proc=/proc", "mount") if err == nil || !(strings.Contains(strings.ToLower(out), "permission denied") || strings.Contains(strings.ToLower(out), "operation not permitted")) { @@ -2925,7 +2925,7 @@ func (s *DockerCLIRunSuite) TestRunUnshareProc(c *testing.T) { go func() { name := "cereal" - out, _, err := dockerCmdWithError("run", "--name", name, "--security-opt", "seccomp=unconfined", "debian:bullseye-slim", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc") + out, _, err := dockerCmdWithError("run", "--name", name, "--security-opt", "seccomp=unconfined", "debian:bookworm-slim", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc") if err == nil || !(strings.Contains(strings.ToLower(out), "mount: cannot mount none") || strings.Contains(strings.ToLower(out), "permission denied") || @@ -2939,7 +2939,7 @@ func (s *DockerCLIRunSuite) TestRunUnshareProc(c *testing.T) { /* Ensure still fails if running privileged with the default policy */ go func() { name := "crashoverride" - out, _, err := dockerCmdWithError("run", "--privileged", "--security-opt", "seccomp=unconfined", "--security-opt", "apparmor=docker-default", "--name", name, "debian:bullseye-slim", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc") + out, _, err := dockerCmdWithError("run", "--privileged", "--security-opt", "seccomp=unconfined", "--security-opt", "apparmor=docker-default", "--name", name, "debian:bookworm-slim", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc") if err == nil || !(strings.Contains(strings.ToLower(out), "mount: cannot mount none") || strings.Contains(strings.ToLower(out), "permission denied") || diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go index 381776b239..61c6066993 100644 --- a/integration-cli/docker_cli_run_unix_test.go +++ b/integration-cli/docker_cli_run_unix_test.go @@ -840,12 +840,12 @@ func (s *DockerCLIRunSuite) TestRunTmpfsMountsWithOptions(c *testing.T) { assert.Assert(c, strings.Contains(out, option)) } - // We use debian:bullseye-slim as there is no findmnt in busybox. Also the output will be in the format of + // We use debian:bookworm-slim as there is no findmnt in busybox. Also the output will be in the format of // TARGET PROPAGATION // /tmp shared // so we only capture `shared` here. expectedOptions = []string{"shared"} - out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:shared", "debian:bullseye-slim", "findmnt", "-o", "TARGET,PROPAGATION", "/tmp") + out, _ = dockerCmd(c, "run", "--tmpfs", "/tmp:shared", "debian:bookworm-slim", "findmnt", "-o", "TARGET,PROPAGATION", "/tmp") for _, option := range expectedOptions { assert.Assert(c, strings.Contains(out, option)) } @@ -881,7 +881,7 @@ func (s *DockerCLIRunSuite) TestRunSysctls(c *testing.T) { }) } -// TestRunSeccompProfileDenyUnshare checks that 'docker run --security-opt seccomp=/tmp/profile.json debian:bullseye-slim unshare' exits with operation not permitted. +// TestRunSeccompProfileDenyUnshare checks that 'docker run --security-opt seccomp=/tmp/profile.json debian:bookworm-slim unshare' exits with operation not permitted. func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyUnshare(c *testing.T) { testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotArm, Apparmor) jsonData := `{ @@ -904,7 +904,7 @@ func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyUnshare(c *testing.T) { } icmd.RunCommand(dockerBinary, "run", "--security-opt", "apparmor=unconfined", "--security-opt", "seccomp="+tmpFile.Name(), - "debian:bullseye-slim", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc").Assert(c, icmd.Expected{ + "debian:bookworm-slim", "unshare", "-p", "-m", "-f", "-r", "mount", "-t", "proc", "none", "/proc").Assert(c, icmd.Expected{ ExitCode: 1, Err: "Operation not permitted", }) @@ -944,7 +944,7 @@ func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyChmod(c *testing.T) { }) } -// TestRunSeccompProfileDenyUnshareUserns checks that 'docker run debian:bullseye-slim unshare --map-root-user --user sh -c whoami' with a specific profile to +// TestRunSeccompProfileDenyUnshareUserns checks that 'docker run debian:bookworm-slim unshare --map-root-user --user sh -c whoami' with a specific profile to // deny unshare of a userns exits with operation not permitted. func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyUnshareUserns(c *testing.T) { testRequires(c, testEnv.IsLocalDaemon, seccompEnabled, NotArm, Apparmor) @@ -976,7 +976,7 @@ func (s *DockerCLIRunSuite) TestRunSeccompProfileDenyUnshareUserns(c *testing.T) } icmd.RunCommand(dockerBinary, "run", "--security-opt", "apparmor=unconfined", "--security-opt", "seccomp="+tmpFile.Name(), - "debian:bullseye-slim", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami").Assert(c, icmd.Expected{ + "debian:bookworm-slim", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami").Assert(c, icmd.Expected{ ExitCode: 1, Err: "Operation not permitted", }) @@ -1028,12 +1028,12 @@ func (s *DockerCLIRunSuite) TestRunSeccompProfileAllow32Bit(c *testing.T) { icmd.RunCommand(dockerBinary, "run", "syscall-test", "exit32-test").Assert(c, icmd.Success) } -// TestRunSeccompAllowSetrlimit checks that 'docker run debian:bullseye-slim ulimit -v 1048510' succeeds. +// TestRunSeccompAllowSetrlimit checks that 'docker run debian:bookworm-slim ulimit -v 1048510' succeeds. func (s *DockerCLIRunSuite) TestRunSeccompAllowSetrlimit(c *testing.T) { testRequires(c, testEnv.IsLocalDaemon, seccompEnabled) // ulimit uses setrlimit, so we want to make sure we don't break it - icmd.RunCommand(dockerBinary, "run", "debian:bullseye-slim", "bash", "-c", "ulimit -v 1048510").Assert(c, icmd.Success) + icmd.RunCommand(dockerBinary, "run", "debian:bookworm-slim", "bash", "-c", "ulimit -v 1048510").Assert(c, icmd.Success) } func (s *DockerCLIRunSuite) TestRunSeccompDefaultProfileAcct(c *testing.T) { @@ -1329,7 +1329,7 @@ func (s *DockerCLIRunSuite) TestRunApparmorProcDirectory(c *testing.T) { func (s *DockerCLIRunSuite) TestRunSeccompWithDefaultProfile(c *testing.T) { testRequires(c, testEnv.IsLocalDaemon, seccompEnabled) - out, _, err := dockerCmdWithError("run", "--security-opt", "seccomp=../profiles/seccomp/default.json", "debian:bullseye-slim", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami") + out, _, err := dockerCmdWithError("run", "--security-opt", "seccomp=../profiles/seccomp/default.json", "debian:bookworm-slim", "unshare", "--map-root-user", "--user", "sh", "-c", "whoami") assert.ErrorContains(c, err, "", out) assert.Equal(c, strings.TrimSpace(out), "unshare: unshare failed: Operation not permitted") } diff --git a/integration-cli/fixtures_linux_daemon_test.go b/integration-cli/fixtures_linux_daemon_test.go index b91b510c1f..8a68dc4440 100644 --- a/integration-cli/fixtures_linux_daemon_test.go +++ b/integration-cli/fixtures_linux_daemon_test.go @@ -48,7 +48,7 @@ func ensureSyscallTest(c *testing.T) { dockerFile := filepath.Join(tmp, "Dockerfile") content := []byte(` - FROM debian:bullseye-slim + FROM debian:bookworm-slim COPY . /usr/bin/ `) err = os.WriteFile(dockerFile, content, 0600) @@ -64,7 +64,7 @@ func ensureSyscallTest(c *testing.T) { } func ensureSyscallTestBuild(c *testing.T) { - err := load.FrozenImagesLinux(testEnv.APIClient(), "debian:bullseye-slim") + err := load.FrozenImagesLinux(testEnv.APIClient(), "debian:bookworm-slim") assert.NilError(c, err) var buildArgs []string @@ -102,7 +102,7 @@ func ensureNNPTest(c *testing.T) { dockerfile := filepath.Join(tmp, "Dockerfile") content := ` - FROM debian:bullseye-slim + FROM debian:bookworm-slim COPY . /usr/bin RUN chmod +s /usr/bin/nnp-test ` @@ -119,7 +119,7 @@ func ensureNNPTest(c *testing.T) { } func ensureNNPTestBuild(c *testing.T) { - err := load.FrozenImagesLinux(testEnv.APIClient(), "debian:bullseye-slim") + err := load.FrozenImagesLinux(testEnv.APIClient(), "debian:bookworm-slim") assert.NilError(c, err) var buildArgs []string diff --git a/integration/build/build_userns_linux_test.go b/integration/build/build_userns_linux_test.go index dbb70f5961..6baf46240b 100644 --- a/integration/build/build_userns_linux_test.go +++ b/integration/build/build_userns_linux_test.go @@ -42,7 +42,7 @@ func TestBuildUserNamespaceValidateCapabilitiesAreV2(t *testing.T) { clientUserRemap := dUserRemap.NewClientT(t) defer clientUserRemap.Close() - err = load.FrozenImagesLinux(clientUserRemap, "debian:bullseye-slim") + err = load.FrozenImagesLinux(clientUserRemap, "debian:bookworm-slim") assert.NilError(t, err) dUserRemapRunning := true @@ -54,7 +54,7 @@ func TestBuildUserNamespaceValidateCapabilitiesAreV2(t *testing.T) { }() dockerfile := ` - FROM debian:bullseye-slim + FROM debian:bookworm-slim RUN apt-get update && apt-get install -y libcap2-bin --no-install-recommends RUN setcap CAP_NET_BIND_SERVICE=+eip /bin/sleep ` diff --git a/testutil/environment/protect.go b/testutil/environment/protect.go index c15d4ca953..bd2df59783 100644 --- a/testutil/environment/protect.go +++ b/testutil/environment/protect.go @@ -10,7 +10,7 @@ import ( "gotest.tools/v3/assert" ) -var frozenImages = []string{"busybox:latest", "busybox:glibc", "hello-world:frozen", "debian:bullseye-slim"} +var frozenImages = []string{"busybox:latest", "busybox:glibc", "hello-world:frozen", "debian:bookworm-slim"} type protectedElements struct { containers map[string]struct{}