Skip to content

Commit b915daa

Browse files
davidmreedClaudezimegmwbrooks
authored
chore(examples): move Docker images to bases with fixed ca-certificates (#1602)
Co-authored-by: Claude <svc-devxp-claude@slack-corp.com> Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com> Co-authored-by: Michael Brooks <mbrooks@slack-corp.com>
1 parent dfde510 commit b915daa

9 files changed

Lines changed: 51 additions & 14 deletions

File tree

‎examples/docker/aiohttp/Dockerfile‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#
22
# docker build . -t your-repo/hello-bolt
33
#
4-
FROM python:3.8.5-slim-buster as builder
4+
FROM python:3.8-slim-bookworm as builder
55
RUN apt-get update && apt-get clean
66
COPY requirements.txt /build/
77
WORKDIR /build/
88
RUN pip install -U pip && pip install -r requirements.txt
99

10-
FROM python:3.8.5-slim-buster as app
10+
FROM python:3.8-slim-bookworm as app
11+
# Refresh the OS trust store so the image gets the latest ca-certificates.
12+
RUN apt-get update \
13+
&& apt-get install -y --no-install-recommends ca-certificates \
14+
&& rm -rf /var/lib/apt/lists/*
1115
COPY --from=builder /build/ /app/
1216
COPY --from=builder /usr/local/lib/ /usr/local/lib/
1317
WORKDIR /app/

‎examples/docker/asgi/Dockerfile‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#
22
# docker build . -t your-repo/hello-bolt
33
#
4-
FROM python:3.11-alpine3.17 as builder
4+
FROM python:3.11-alpine3.20 as builder
55
COPY requirements.txt /build/
66
WORKDIR /build/
77
RUN pip install -U pip && pip install -r requirements.txt
88

9-
FROM python:3.11-alpine3.17 as app
9+
FROM python:3.11-alpine3.20 as app
10+
# Refresh the OS trust store so the image gets the latest ca-certificates.
11+
RUN apk add --no-cache --upgrade ca-certificates ca-certificates-bundle
1012
WORKDIR /app/
1113
COPY --from=builder /usr/local/bin/ /usr/local/bin/
1214
COPY --from=builder /usr/local/lib/ /usr/local/lib/

‎examples/docker/fastapi-gunicorn/Dockerfile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# docker build . -t your-repo/hello-bolt
33
#
44
FROM tiangolo/uvicorn-gunicorn:python3.8-slim
5+
# Refresh the OS trust store so the image gets the latest ca-certificates.
6+
RUN apt-get update \
7+
&& apt-get install -y --no-install-recommends ca-certificates \
8+
&& rm -rf /var/lib/apt/lists/*
59
WORKDIR /app/
610
COPY *.py /app/
711
COPY requirements.txt /app/

‎examples/docker/flask-gunicorn/Dockerfile‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
#
22
# docker build . -t your-repo/hello-bolt
33
#
4-
FROM python:3.8.5-slim-buster as builder
4+
FROM python:3.8-slim-bookworm as builder
55
COPY requirements.txt /build/
66
WORKDIR /build/
77
RUN pip install -U pip && pip install -r requirements.txt
88

9-
FROM python:3.8.5-slim-buster as app
9+
FROM python:3.8-slim-bookworm as app
10+
# Refresh the OS trust store so the image gets the latest ca-certificates.
11+
RUN apt-get update \
12+
&& apt-get install -y --no-install-recommends ca-certificates \
13+
&& rm -rf /var/lib/apt/lists/*
1014
WORKDIR /app/
1115
COPY --from=builder /usr/local/bin/ /usr/local/bin/
1216
COPY --from=builder /usr/local/lib/ /usr/local/lib/

‎examples/docker/flask-uwsgi/Dockerfile‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
#
22
# docker build . -t your-repo/hello-bolt
33
#
4-
FROM python:3.8.5-slim-buster as builder
4+
FROM python:3.8-slim-bookworm as builder
55
RUN apt-get update \
6-
&& apt-get -y install build-essential libpcre3-dev \
6+
&& apt-get -y install build-essential libpcre2-dev \
77
&& apt-get clean
88
COPY requirements.txt /build/
99
WORKDIR /build/
1010
RUN pip install -U pip && pip install -r requirements.txt
1111

12-
FROM python:3.8.5-slim-buster as app
12+
FROM python:3.8-slim-bookworm as app
13+
# Refresh the OS trust store so the image gets the latest ca-certificates.
14+
RUN apt-get update \
15+
&& apt-get install -y --no-install-recommends ca-certificates \
16+
&& rm -rf /var/lib/apt/lists/*
1317
WORKDIR /app/
1418
COPY --from=builder /usr/local/bin/ /usr/local/bin/
1519
COPY --from=builder /usr/local/lib/ /usr/local/lib/

‎examples/docker/sanic/Dockerfile‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
#
22
# docker build . -t your-repo/hello-bolt
33
#
4-
FROM python:3.8.5-slim-buster as builder
4+
FROM python:3.8-slim-bookworm as builder
55
COPY requirements.txt /build/
66
WORKDIR /build/
77
RUN pip install -U pip && pip install -r requirements.txt
88

9-
FROM python:3.8.5-slim-buster as app
9+
FROM python:3.8-slim-bookworm as app
10+
# Refresh the OS trust store so the image gets the latest ca-certificates.
11+
RUN apt-get update \
12+
&& apt-get install -y --no-install-recommends ca-certificates \
13+
&& rm -rf /var/lib/apt/lists/*
1014
WORKDIR /app/
1115
COPY *.py /app/
1216
COPY --from=builder /usr/local/bin/ /usr/local/bin/

‎examples/google_cloud_run/aiohttp/Dockerfile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
# ----------------------------------------------
1212
# Use the official lightweight Python image.
1313
# https://hub.docker.com/_/python
14-
FROM python:3.8.5-slim-buster
14+
FROM python:3.8-slim-bookworm
15+
16+
# Refresh the OS trust store so the image gets the latest ca-certificates.
17+
RUN apt-get update \
18+
&& apt-get install -y --no-install-recommends ca-certificates \
19+
&& rm -rf /var/lib/apt/lists/*
1520

1621
# Allow statements and log messages to immediately appear in the Knative logs
1722
ENV PYTHONUNBUFFERED True

‎examples/google_cloud_run/flask-gunicorn/Dockerfile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
# ----------------------------------------------
1212
# Use the official lightweight Python image.
1313
# https://hub.docker.com/_/python
14-
FROM python:3.8.5-slim-buster
14+
FROM python:3.8-slim-bookworm
15+
16+
# Refresh the OS trust store so the image gets the latest ca-certificates.
17+
RUN apt-get update \
18+
&& apt-get install -y --no-install-recommends ca-certificates \
19+
&& rm -rf /var/lib/apt/lists/*
1520

1621
# Allow statements and log messages to immediately appear in the Knative logs
1722
ENV PYTHONUNBUFFERED True

‎examples/google_cloud_run/sanic/Dockerfile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
# ----------------------------------------------
1212
# Use the official lightweight Python image.
1313
# https://hub.docker.com/_/python
14-
FROM python:3.8.5-slim-buster
14+
FROM python:3.8-slim-bookworm
15+
16+
# Refresh the OS trust store so the image gets the latest ca-certificates.
17+
RUN apt-get update \
18+
&& apt-get install -y --no-install-recommends ca-certificates \
19+
&& rm -rf /var/lib/apt/lists/*
1520

1621
# Allow statements and log messages to immediately appear in the Knative logs
1722
ENV PYTHONUNBUFFERED True

0 commit comments

Comments
 (0)