From a97431809d73d4e470d08ae655d571006bfddd91 Mon Sep 17 00:00:00 2001 From: Elise Ng Date: Mon, 17 Jun 2024 18:50:49 -0400 Subject: [PATCH 1/2] Adopt ubuntu base for docker images --- cmd/authgear/Dockerfile | 8 +++---- cmd/portal/Dockerfile | 8 +++---- custombuild/cmd/authgearx/Dockerfile | 8 +++---- custombuild/cmd/portalx/Dockerfile | 32 ++++++++++++++-------------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/cmd/authgear/Dockerfile b/cmd/authgear/Dockerfile index 63af79a77e..fa115ed081 100644 --- a/cmd/authgear/Dockerfile +++ b/cmd/authgear/Dockerfile @@ -1,5 +1,5 @@ # Stage 1: Build the Go binary -FROM golang:1.22.4-bookworm as stage1 +FROM quay.io/theauthgear/golang:1.22.4-noble as stage1 # Install build time C dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ @@ -32,10 +32,10 @@ COPY . . RUN make authui GIT_HASH=$GIT_HASH # Stage 3: Prepare the actual fs we use to run the program -FROM debian:bookworm-slim +FROM ubuntu:noble ARG GIT_HASH WORKDIR /app -# /etc/mime.types (mime-support) +# /etc/mime.types (media-types) # /usr/share/ca-certificates/*/* (ca-certificates) # /usr/share/zoneinfo/ (tzdata) RUN apt-get update && apt-get install -y --no-install-recommends \ @@ -44,7 +44,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libmagic-dev \ libmagic-mgc \ ca-certificates \ - mime-support \ + media-types \ tzdata \ && rm -rf /var/lib/apt/lists/* RUN update-ca-certificates diff --git a/cmd/portal/Dockerfile b/cmd/portal/Dockerfile index bb59f60e50..bf54d0105a 100644 --- a/cmd/portal/Dockerfile +++ b/cmd/portal/Dockerfile @@ -1,5 +1,5 @@ # Stage 1: Build the Go binary -FROM golang:1.22.4-bookworm as stage1 +FROM quay.io/theauthgear/golang:1.22.4-noble as stage1 # Install build time C dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ @@ -42,10 +42,10 @@ COPY ./portal . RUN npm run build # Stage 4: Prepare the actual fs we use to run the program -FROM debian:bookworm-slim +FROM ubuntu:noble ARG GIT_HASH WORKDIR /app -# /etc/mime.types (mime-support) +# /etc/mime.types (media-types) # /usr/share/ca-certificates/*/* (ca-certificates) # /usr/share/zoneinfo/ (tzdata) RUN apt-get update && apt-get install -y --no-install-recommends \ @@ -54,7 +54,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libmagic-dev \ libmagic-mgc \ ca-certificates \ - mime-support \ + media-types \ tzdata \ && rm -rf /var/lib/apt/lists/* RUN update-ca-certificates diff --git a/custombuild/cmd/authgearx/Dockerfile b/custombuild/cmd/authgearx/Dockerfile index f03195ca7a..bcd3313684 100644 --- a/custombuild/cmd/authgearx/Dockerfile +++ b/custombuild/cmd/authgearx/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # Stage 1: Build the Go binary -FROM golang:1.22.4-bookworm as stage1 +FROM quay.io/theauthgear/golang:1.22.4-noble as stage1 # Install build time C dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ @@ -50,10 +50,10 @@ COPY . . RUN make authui GIT_HASH=$GIT_HASH # Stage 3: Prepare the actual fs we use to run the program -FROM debian:bookworm-slim +FROM ubuntu:noble ARG GIT_HASH WORKDIR /app -# /etc/mime.types (mime-support) +# /etc/mime.types (media-types) # /usr/share/ca-certificates/*/* (ca-certificates) # /usr/share/zoneinfo/ (tzdata) RUN apt-get update && apt-get install -y --no-install-recommends \ @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ libmagic-dev \ libmagic-mgc \ ca-certificates \ - mime-support \ + media-types \ tzdata \ && rm -rf /var/lib/apt/lists/* RUN update-ca-certificates diff --git a/custombuild/cmd/portalx/Dockerfile b/custombuild/cmd/portalx/Dockerfile index 3e7371a48e..3702f96b57 100644 --- a/custombuild/cmd/portalx/Dockerfile +++ b/custombuild/cmd/portalx/Dockerfile @@ -1,15 +1,15 @@ # syntax=docker/dockerfile:1 # Stage 1: Build the Go binary -FROM golang:1.22.4-bookworm as stage1 +FROM quay.io/theauthgear/golang:1.22.4-noble as stage1 # Install build time C dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ - pkg-config \ - libicu-dev \ - libvips-dev \ - libmagic-dev \ - && rm -rf /var/lib/apt/lists/* + pkg-config \ + libicu-dev \ + libvips-dev \ + libmagic-dev \ + && rm -rf /var/lib/apt/lists/* # In order to build a Go program that uses private modules in Docker, # we need the following @@ -60,21 +60,21 @@ COPY ./portal . RUN npm run build # Stage 4: Prepare the actual fs we use to run the program -FROM debian:bookworm-slim +FROM ubuntu:noble ARG GIT_HASH WORKDIR /app -# /etc/mime.types (mime-support) +# /etc/mime.types (media-types) # /usr/share/ca-certificates/*/* (ca-certificates) # /usr/share/zoneinfo/ (tzdata) RUN apt-get update && apt-get install -y --no-install-recommends \ - libicu-dev \ - libvips-dev \ - libmagic-dev \ - libmagic-mgc \ - ca-certificates \ - mime-support \ - tzdata \ - && rm -rf /var/lib/apt/lists/* + libicu-dev \ + libvips-dev \ + libmagic-dev \ + libmagic-mgc \ + ca-certificates \ + media-types \ + tzdata \ + && rm -rf /var/lib/apt/lists/* RUN update-ca-certificates COPY ./GeoLite2-Country.mmdb ./GeoLite2-Country.mmdb COPY ./migrations ./migrations From 495bf52b79e3daba4f216a8704a1d23ec9fd3ee0 Mon Sep 17 00:00:00 2001 From: Elise Ng Date: Thu, 20 Jun 2024 20:19:28 -0400 Subject: [PATCH 2/2] Run apt upgrade on runtime stage when building image Ref DEV-1379 --- cmd/authgear/Dockerfile | 2 +- cmd/portal/Dockerfile | 2 +- custombuild/cmd/authgearx/Dockerfile | 2 +- custombuild/cmd/portalx/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/authgear/Dockerfile b/cmd/authgear/Dockerfile index fa115ed081..8d968c4410 100644 --- a/cmd/authgear/Dockerfile +++ b/cmd/authgear/Dockerfile @@ -46,7 +46,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ media-types \ tzdata \ - && rm -rf /var/lib/apt/lists/* + && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* RUN update-ca-certificates COPY ./GeoLite2-Country.mmdb ./GeoLite2-Country.mmdb COPY ./migrations ./migrations diff --git a/cmd/portal/Dockerfile b/cmd/portal/Dockerfile index bf54d0105a..b54622601d 100644 --- a/cmd/portal/Dockerfile +++ b/cmd/portal/Dockerfile @@ -56,7 +56,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ media-types \ tzdata \ - && rm -rf /var/lib/apt/lists/* + && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* RUN update-ca-certificates COPY ./GeoLite2-Country.mmdb ./GeoLite2-Country.mmdb COPY ./migrations ./migrations diff --git a/custombuild/cmd/authgearx/Dockerfile b/custombuild/cmd/authgearx/Dockerfile index bcd3313684..4e932b55a7 100644 --- a/custombuild/cmd/authgearx/Dockerfile +++ b/custombuild/cmd/authgearx/Dockerfile @@ -64,7 +64,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ media-types \ tzdata \ - && rm -rf /var/lib/apt/lists/* + && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* RUN update-ca-certificates COPY ./GeoLite2-Country.mmdb ./GeoLite2-Country.mmdb COPY ./migrations ./migrations diff --git a/custombuild/cmd/portalx/Dockerfile b/custombuild/cmd/portalx/Dockerfile index 3702f96b57..fef44c899c 100644 --- a/custombuild/cmd/portalx/Dockerfile +++ b/custombuild/cmd/portalx/Dockerfile @@ -74,7 +74,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ media-types \ tzdata \ - && rm -rf /var/lib/apt/lists/* + && apt-get upgrade -y && rm -rf /var/lib/apt/lists/* RUN update-ca-certificates COPY ./GeoLite2-Country.mmdb ./GeoLite2-Country.mmdb COPY ./migrations ./migrations