fix(dogfood/Dockerfile): create /etc/suoders.d/nopasswd instead of COPY (#13900)

This commit is contained in:
Cian Johnston
2024-07-15 23:19:23 +01:00
committed by GitHub
parent ab59460e2c
commit 36454aa81b
2 changed files with 6 additions and 2 deletions
+6
View File
@@ -91,6 +91,12 @@ SHELL ["/bin/bash", "-c"]
RUN apt-get update && apt-get install --yes ca-certificates
COPY files /
# We used to copy /etc/sudoers.d/* in from files/ but this causes issues with
# permissions and layer caching. Instead, create the file directly.
RUN mkdir -p /etc/sudoers.d && \
echo 'coder ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/nopasswd && \
chmod 750 /etc/sudoers.d/ && \
chmod 640 /etc/sudoers.d/nopasswd
# Install packages from apt repositories
ARG DEBIAN_FRONTEND="noninteractive"
-2
View File
@@ -1,2 +0,0 @@
# Allow the Coder user to execute sudo without a password
coder ALL=(ALL) NOPASSWD:ALL