From d5c95272e973084e9c850f0f29132d38642aaf01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=28Kusalananda=29=20K=C3=A4h=C3=A4ri?= Date: Thu, 29 Aug 2024 20:15:58 +0200 Subject: [PATCH 1/5] fix: Bump gcc version and use unversioned Alpine base image --- backend/Dockerfile | 4 ++-- production/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index a02f3a52..7289cef2 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20-alpine3.18 +FROM golang:1.20-alpine ENV XDG_CACHE_HOME='/tmp/.cache' @@ -8,7 +8,7 @@ SHELL ["/bin/ash", "-o", "pipefail", "-c"] RUN apk --no-cache add \ 'curl=~8' \ - 'gcc=~12' \ + 'gcc=~13' \ 'musl-dev=~1.2'; \ curl --silent --fail --location \ 'https://raw.githubusercontent.com/cosmtrek/air/v1.44.0/install.sh' | \ diff --git a/production/Dockerfile b/production/Dockerfile index 5313cbbd..20bde55a 100644 --- a/production/Dockerfile +++ b/production/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /go COPY ./ . RUN apk --no-cache add \ - 'gcc=~12' \ + 'gcc=~13' \ 'musl-dev=~1.2' ENV GOPATH=$PWD From 3f446d070117fba0594cf27a0a45737f9de4fa89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=28Kusalananda=29=20K=C3=A4h=C3=A4ri?= Date: Thu, 29 Aug 2024 20:29:20 +0200 Subject: [PATCH 2/5] chore: Also bump the Go version to 1.23 as suggested by dependabot in other PR --- backend/Dockerfile | 2 +- production/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 7289cef2..d69affd3 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20-alpine +FROM golang:1.23-alpine ENV XDG_CACHE_HOME='/tmp/.cache' diff --git a/production/Dockerfile b/production/Dockerfile index 20bde55a..4d8af75f 100644 --- a/production/Dockerfile +++ b/production/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20-alpine as builder +FROM golang:1.23-alpine as builder RUN addgroup -S urdr && getent group urdr >/tmp/group RUN adduser -S urdr && getent passwd urdr >/tmp/passwd From f93510ca3579ceb4dd89d97c2b7c0a48a4ab646f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=28Kusalananda=29=20K=C3=A4h=C3=A4ri?= Date: Fri, 6 Sep 2024 09:55:48 +0200 Subject: [PATCH 3/5] fix: Pin Alpine base images to 3.20 --- backend/Dockerfile | 2 +- production/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index d69affd3..df8513fa 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.23-alpine +FROM golang:1.23-alpine3.20 ENV XDG_CACHE_HOME='/tmp/.cache' diff --git a/production/Dockerfile b/production/Dockerfile index 4d8af75f..4a09d630 100644 --- a/production/Dockerfile +++ b/production/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.23-alpine as builder +FROM golang:1.23-alpine3.20 as builder RUN addgroup -S urdr && getent group urdr >/tmp/group RUN adduser -S urdr && getent passwd urdr >/tmp/passwd From 745c7ad1565e1aa15adb4b1d0107c7cbc1a5d2a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=28Kusalananda=29=20K=C3=A4h=C3=A4ri?= Date: Fri, 6 Sep 2024 09:57:08 +0200 Subject: [PATCH 4/5] chore: Remove deprecated "version" from Docker compose files --- docker-compose.yml | 1 - production/docker-compose.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 155b923a..528e6506 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,4 @@ --- -version: "3" services: diff --git a/production/docker-compose.yml b/production/docker-compose.yml index e45e5e3b..e04919be 100644 --- a/production/docker-compose.yml +++ b/production/docker-compose.yml @@ -1,5 +1,4 @@ --- -version: "3" services: From d88a4100cf9e300d8f495ce3fe24179025559415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=28Kusalananda=29=20K=C3=A4h=C3=A4ri?= Date: Fri, 6 Sep 2024 15:39:20 +0200 Subject: [PATCH 5/5] chore: Uppercase "AS" in "FROM ... AS ..." in Dockerfile Found by @pdmnyberg --- node/Dockerfile | 2 +- production/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/node/Dockerfile b/node/Dockerfile index 35914850..eff552e2 100644 --- a/node/Dockerfile +++ b/node/Dockerfile @@ -1,4 +1,4 @@ -FROM node:20.3.0-alpine as build +FROM node:20.3.0-alpine AS build USER node RUN mkdir /home/node/app diff --git a/production/Dockerfile b/production/Dockerfile index 4a09d630..72977914 100644 --- a/production/Dockerfile +++ b/production/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.23-alpine3.20 as builder +FROM golang:1.23-alpine3.20 AS builder RUN addgroup -S urdr && getent group urdr >/tmp/group RUN adduser -S urdr && getent passwd urdr >/tmp/passwd