Skip to content

Commit

Permalink
Start from python:310-slim instead of ubuntu:noble.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamghill committed Oct 27, 2024
1 parent 98d87f1 commit e488c23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.9
FROM ubuntu:noble AS build
FROM python:3.10-slim AS build

# The following does not work in Podman unless you build in Docker
# compatibility mode: <https://github.com/containers/podman/issues/8477>
Expand All @@ -17,7 +17,6 @@ apt-get install -qyy \
build-essential \
ca-certificates \
python3-setuptools \
python3.12-dev \
libssl-dev \
libffi-dev
EOT
Expand All @@ -33,7 +32,7 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
ENV UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
UV_PYTHON_DOWNLOADS=never \
UV_PYTHON=python3.12 \
UV_PYTHON=python3.10 \
UV_PROJECT_ENVIRONMENT=/app

### End build prep -- this is where your app Dockerfile should start.
Expand Down Expand Up @@ -72,7 +71,7 @@ EOT

##########################################################################

FROM ubuntu:noble
FROM python:3.10-slim
SHELL ["sh", "-exc"]

# Optional: add the application virtualenv to search path.
Expand All @@ -95,8 +94,8 @@ apt-get update -qy
apt-get install -qyy \
-o APT::Install-Recommends=false \
-o APT::Install-Suggests=false \
python3.12 \
libpython3.12 \
python3.10 \
libpython3.10 \
libpcre3 \
libxml2 \
ca-certificates \
Expand Down
11 changes: 5 additions & 6 deletions Dockerfile-q2-worker
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.9
FROM ubuntu:noble AS build
FROM python:3.10-slim AS build

# The following does not work in Podman unless you build in Docker
# compatibility mode: <https://github.com/containers/podman/issues/8477>
Expand All @@ -17,7 +17,6 @@ apt-get install -qyy \
build-essential \
ca-certificates \
python3-setuptools \
python3.12-dev \
libssl-dev \
libffi-dev
EOT
Expand All @@ -33,7 +32,7 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
ENV UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
UV_PYTHON_DOWNLOADS=never \
UV_PYTHON=python3.12 \
UV_PYTHON=python3.10 \
UV_PROJECT_ENVIRONMENT=/app

### End build prep -- this is where your app Dockerfile should start.
Expand Down Expand Up @@ -72,7 +71,7 @@ EOT

##########################################################################

FROM ubuntu:noble
FROM python:3.10-slim
SHELL ["sh", "-exc"]

# Optional: add the application virtualenv to search path.
Expand All @@ -95,8 +94,8 @@ apt-get update -qy
apt-get install -qyy \
-o APT::Install-Recommends=false \
-o APT::Install-Suggests=false \
python3.12 \
libpython3.12 \
python3.10 \
libpython3.10 \
libpcre3 \
libxml2 \
ca-certificates \
Expand Down

0 comments on commit e488c23

Please sign in to comment.