From f7bff1b6975daa9038f46c52cd97071c7a4b37a5 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Mon, 26 Feb 2024 16:30:54 +0100 Subject: [PATCH 1/3] fix(docker): image now builds adding non root user execution capabilities --- misc/docker/Dockerfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/misc/docker/Dockerfile b/misc/docker/Dockerfile index e631f6a..76e0918 100644 --- a/misc/docker/Dockerfile +++ b/misc/docker/Dockerfile @@ -1,11 +1,11 @@ -FROM golang:1.19 AS build +FROM reg.cadoles.com/dh/library/golang:1.17 AS build ARG HTTP_PROXY= ARG HTTPS_PROXY= ARG http_proxy= ARG https_proxy= -RUN apt-get update && apt-get install -y build-essential git bash curl +RUN apt-get update && apt-get install -y build-essential git bash curl npm python2 RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - \ && apt-get install -y nodejs @@ -20,12 +20,13 @@ RUN cp -f misc/docker/config-patch.txt misc/release/config-patch.txt \ FROM busybox +RUN adduser -D -h /app fsmtp + COPY --from=build /src/release/fake-smtp-linux-amd64 /app - -WORKDIR /app - -RUN mkdir -p /app +RUN chown -R fsmtp:fsmtp /app EXPOSE 8080 2525 +USER fsmtp +WORKDIR /app CMD ["bin/fake-smtp", "--config", "config.yml"] \ No newline at end of file From d47b819e1dc03b2a66707bed01de819879100cfe Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 27 Feb 2024 17:14:25 +0100 Subject: [PATCH 2/3] feat(docker): use go 1.21 --- misc/docker/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/docker/Dockerfile b/misc/docker/Dockerfile index 76e0918..cb10b7f 100644 --- a/misc/docker/Dockerfile +++ b/misc/docker/Dockerfile @@ -1,11 +1,11 @@ -FROM reg.cadoles.com/dh/library/golang:1.17 AS build +FROM reg.cadoles.com/proxy_cache/library/golang:1.21 AS build ARG HTTP_PROXY= ARG HTTPS_PROXY= ARG http_proxy= ARG https_proxy= -RUN apt-get update && apt-get install -y build-essential git bash curl npm python2 +RUN apt-get update && apt-get install -y build-essential git bash curl RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - \ && apt-get install -y nodejs @@ -18,7 +18,7 @@ RUN cp -f misc/docker/config-patch.txt misc/release/config-patch.txt \ && npm ci \ && make ARCH_TARGETS=amd64 release -FROM busybox +FROM reg.cadoles.com/proxy_cache/library/busybox RUN adduser -D -h /app fsmtp From 4871876bf0b20048df9b51faa1f8356c48fd6747 Mon Sep 17 00:00:00 2001 From: William Petit Date: Tue, 27 Feb 2024 17:19:16 +0100 Subject: [PATCH 3/3] chore: use go run to exec modd --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8d1422f..f483a29 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ tidy: go mod tidy watch: - modd + go run github.com/cortesi/modd/cmd/modd@v0.8.1 lint: golangci-lint run --enable-all