diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 347a5a1..0000000 --- a/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM ubuntu:latest - -ARG DEBIAN_FRONTEND=noninteractive - -RUN apt-get update && apt-get -y install apt-utils adduser sudo - -RUN useradd -m testuser && echo "testuser:testuserpw" | chpasswd && adduser testuser sudo -RUN echo "testuser ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/testuser - -USER testuser -CMD /bin/bash -WORKDIR /home/testuser diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/docker/dockerimages/DockerImages.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/docker/dockerimages/DockerImages.kt index 208ea36..94c69a2 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/docker/dockerimages/DockerImages.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/docker/dockerimages/DockerImages.kt @@ -17,7 +17,7 @@ class UbuntuPlusUser(private val userName: String = "testuser") : DockerImage { override fun imageText(): String { return """ -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/platformTest/UbuntuProvTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/platformTest/UbuntuProvTest.kt index 3c0af1e..0ce8d9c 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/platformTest/UbuntuProvTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/platformTest/UbuntuProvTest.kt @@ -103,7 +103,8 @@ internal class UbuntuProvTest { // then assertFalse(result.success) - assertEquals("sudo: no tty present and no askpass program specified\n", result.err) + val expectedMsg = "a password is required" + assertTrue(result.err?.contains(expectedMsg) ?: false, "Error: [$expectedMsg] is not found in [${result.err}]") } } @@ -119,7 +120,7 @@ class UbuntuUserNeedsPasswordForSudo(private val userName: String = "testuser") override fun imageText(): String { return """ -FROM ubuntu:18.04 +FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive