diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fc166f1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +# image for usage in ci pipeline +FROM ubuntu:22.04 + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get -y install apt-utils sudo + +RUN useradd -m testuser && echo "testuser:testuserpw" | chpasswd && usermod -aG sudo testuser +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 94c69a2..1a62a1b 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 @@ -21,8 +21,8 @@ FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get -y install adduser sudo -RUN useradd -m $userName && echo "$userName:$userName" | chpasswd && adduser $userName sudo +RUN apt-get update && apt-get -y install sudo +RUN useradd -m $userName && echo "$userName:$userName" | chpasswd && usermod -aG sudo $userName RUN echo "$userName ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$userName USER $userName 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 0ce8d9c..7128485 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 @@ -124,8 +124,8 @@ FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get -y install adduser sudo -RUN useradd -m $userName && echo "$userName:$userName" | chpasswd && adduser $userName sudo +RUN apt-get update && apt-get -y install sudo +RUN useradd -m $userName && echo "$userName:$userName" | chpasswd && usermod -aG sudo $userName USER $userName CMD /bin/bash