From 654cf57f2643fee2da49b382a84d896aef422d19 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Tue, 18 Aug 2020 16:50:33 -0700 Subject: [PATCH 1/3] Dockerfile: prioritize /etc/hosts over dns --- deploy/kicbase/Dockerfile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/deploy/kicbase/Dockerfile b/deploy/kicbase/Dockerfile index 1ecae0c46189..3eafbb0f5f1d 100644 --- a/deploy/kicbase/Dockerfile +++ b/deploy/kicbase/Dockerfile @@ -56,6 +56,9 @@ RUN echo 'root:root' |chpasswd RUN sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config +# minikube relies on /etc/hosts for control-plane discovery. This prevents nefarious DNS servers from breaking it. +RUN sed -ri 's/dns files/files dns/g' /etc/nsswitch.conf + EXPOSE 22 # create docker user for minikube ssh. to match VM using "docker" as username RUN adduser --ingroup docker --disabled-password --gecos '' docker @@ -69,12 +72,13 @@ USER root RUN mkdir -p /kind # Deleting leftovers RUN apt-get clean -y && rm -rf \ - /var/cache/debconf/* \ - /var/lib/apt/lists/* \ - /var/log/* \ - /tmp/* \ - /var/tmp/* \ - /usr/share/doc/* \ - /usr/share/man/* \ - /usr/share/local/* \ + /var/cache/debconf/* \ + /var/lib/apt/lists/* \ + /var/log/* \ + /tmp/* \ + /var/tmp/* \ + /usr/share/doc/* \ + /usr/share/man/* \ + /usr/share/local/* + RUN echo "kic! Build: ${COMMIT_SHA} Time :$(date)" > "/kic.txt" From c2f0a568ba9b7852c4e9c4ed59ab65c6c5099f53 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 21 Aug 2020 14:55:49 -0700 Subject: [PATCH 2/3] Reduce the diff size --- deploy/kicbase/Dockerfile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/deploy/kicbase/Dockerfile b/deploy/kicbase/Dockerfile index 3eafbb0f5f1d..2ff6044e0aca 100644 --- a/deploy/kicbase/Dockerfile +++ b/deploy/kicbase/Dockerfile @@ -72,13 +72,12 @@ USER root RUN mkdir -p /kind # Deleting leftovers RUN apt-get clean -y && rm -rf \ - /var/cache/debconf/* \ - /var/lib/apt/lists/* \ - /var/log/* \ - /tmp/* \ - /var/tmp/* \ - /usr/share/doc/* \ - /usr/share/man/* \ - /usr/share/local/* - + /var/cache/debconf/* \ + /var/lib/apt/lists/* \ + /var/log/* \ + /tmp/* \ + /var/tmp/* \ + /usr/share/doc/* \ + /usr/share/man/* \ + /usr/share/local/* \ RUN echo "kic! Build: ${COMMIT_SHA} Time :$(date)" > "/kic.txt" From b5ca12cd40212a158dcdddde170a80d5a7862899 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Fri, 21 Aug 2020 14:56:28 -0700 Subject: [PATCH 3/3] Revert whitespace change --- deploy/kicbase/Dockerfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/deploy/kicbase/Dockerfile b/deploy/kicbase/Dockerfile index 2ff6044e0aca..776a03601397 100644 --- a/deploy/kicbase/Dockerfile +++ b/deploy/kicbase/Dockerfile @@ -72,12 +72,12 @@ USER root RUN mkdir -p /kind # Deleting leftovers RUN apt-get clean -y && rm -rf \ - /var/cache/debconf/* \ - /var/lib/apt/lists/* \ - /var/log/* \ - /tmp/* \ - /var/tmp/* \ - /usr/share/doc/* \ - /usr/share/man/* \ - /usr/share/local/* \ + /var/cache/debconf/* \ + /var/lib/apt/lists/* \ + /var/log/* \ + /tmp/* \ + /var/tmp/* \ + /usr/share/doc/* \ + /usr/share/man/* \ + /usr/share/local/* \ RUN echo "kic! Build: ${COMMIT_SHA} Time :$(date)" > "/kic.txt"