From: Erik Brakkee <erik@brakkee.org>
Date: Tue, 12 Nov 2024 19:51:45 +0000 (+0100)
Subject: sudo for ci user, access to docker, added git
X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=9ea3750038cf292eed4c21c2fa591ee0d5198695;p=pipelinelib

sudo for ci user, access to docker, added git
---

diff --git a/images/go-1-23-2/Dockerfile b/images/go-1-23-2/Dockerfile
index c1a6e97..5f07c2e 100644
--- a/images/go-1-23-2/Dockerfile
+++ b/images/go-1-23-2/Dockerfile
@@ -1,6 +1,6 @@
 FROM golang:1.23.3-alpine3.20
 
-RUN apk update && apk add curl make bash docker openssl inetutils-telnet 
+RUN apk update && apk add curl
 
 # if templ cannot be obtained: quick fix, remove this statement and run make, then build the image.
 RUN curl -L https://github.com/a-h/templ/releases/download/v0.2.747/templ_Linux_x86_64.tar.gz -o templ.tar.gz && \
@@ -9,9 +9,18 @@ RUN curl -L https://github.com/a-h/templ/releases/download/v0.2.747/templ_Linux_
     mv templ /bin
 ENV CGO_ENABLED=0
 
+RUN apk update && \
+    apk add make bash docker-cli-compose docker-cli-buildx openssl \
+            inetutils-telnet sudo git
+
 RUN addgroup -g 1000 ci && \
     adduser -D -h /home/ci -G ci -u 1000 ci && \
-    chown -R ci:ci /home/ci
+    chown -R ci:ci /home/ci && \
+    echo "ci ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/ci && \
+    chmod 0440 /etc/sudoers.d/ci && \
+    addgroup -g 2375 docker-external && \
+    adduser ci docker-external
+
 USER ci
 
 ENTRYPOINT ["tail", "-f", "/dev/null" ]