From 9ea3750038cf292eed4c21c2fa591ee0d5198695 Mon Sep 17 00:00:00 2001 From: Erik Brakkee Date: Tue, 12 Nov 2024 20:51:45 +0100 Subject: [PATCH] sudo for ci user, access to docker, added git --- images/go-1-23-2/Dockerfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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" ] -- 2.31.1