From 395d1fd0cbf0c1ac79452ea8d6db7594a4a4e7fa Mon Sep 17 00:00:00 2001 From: mike <219478+ilude@users.noreply.github.com> Date: Mon, 25 Mar 2024 16:50:43 -0400 Subject: [PATCH] changes --- .devcontainer/entrypoint.d/docker-socket-perms.sh | 7 ------- Dockerfile | 12 ++++++++---- 2 files changed, 8 insertions(+), 11 deletions(-) delete mode 100644 .devcontainer/entrypoint.d/docker-socket-perms.sh diff --git a/.devcontainer/entrypoint.d/docker-socket-perms.sh b/.devcontainer/entrypoint.d/docker-socket-perms.sh deleted file mode 100644 index c93852d..0000000 --- a/.devcontainer/entrypoint.d/docker-socket-perms.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Check if /var/run/docker.sock exists -if [ -S "/var/run/docker.sock" ]; then - echo "Docker socket detected. changing ownership to ${USER}:${USER}..." - sudo chown ${USER}:${USER} /var/run/docker.sock -fi \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 05fae99..2be8c11 100755 --- a/Dockerfile +++ b/Dockerfile @@ -40,6 +40,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ less \ locales \ make \ + sudo \ tzdata \ zsh && \ # cleanup @@ -51,6 +52,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN sed -i 's/UID_MAX .*/UID_MAX 100000/' /etc/login.defs && \ groupadd --gid ${PGID} ${USER} && \ useradd --uid ${PUID} --gid ${PGID} -s /bin/${TERM_SHELL} -m ${USER} && \ + echo ${USER} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USER} && \ + chmod 0440 /etc/sudoers.d/${USER} && \ echo "alias l='ls -lhA --color=auto --group-directories-first'" >> /etc/zshenv && \ echo "alias es='env | sort'" >> /etc/zshenv && \ echo "PS1='\h:\$(pwd) \$ '" >> /etc/zshenv && \ @@ -67,6 +70,11 @@ if [ -v DOCKER_ENTRYPOINT_DEBUG ] && [ "$DOCKER_ENTRYPOINT_DEBUG" == 1 ]; then set -o xtrace fi +if [ -S "/var/run/docker.sock" ]; then + echo "Docker socket detected. changing ownership to ${USER}:${USER}..." + sudo chown ${USER}:${USER} /var/run/docker.sock +fi + # Check if the directory exists if [ -d "${PROJECT_PATH}/.devcontainer/entrypoint.d" ]; then # Loop through all *.sh files in the directory and execute them @@ -141,7 +149,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ripgrep \ rsync \ sshpass \ - sudo \ tar \ tree \ util-linux \ @@ -153,9 +160,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ apt-get autoclean -y && \ rm -rf /var/lib/apt/lists/* -RUN echo ${USER} ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/${USER} && \ - chmod 0440 /etc/sudoers.d/${USER} - ENV DOTFILES_URL=https://github.com/ilude/dotfiles.git USER ${USER}