diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index eacef7e716b4..ddd39d219504 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ # Keep this in sync with the base image in the main Dockerfile (ARG PY_VER) -FROM python:3.11.13-bookworm AS base +FROM python:3.11.13-trixie AS base # Install system dependencies that Superset needs # This layer will be cached across Codespace sessions diff --git a/.github/workflows/superset-frontend.yml b/.github/workflows/superset-frontend.yml index 3665c6f05910..943820bc80af 100644 --- a/.github/workflows/superset-frontend.yml +++ b/.github/workflows/superset-frontend.yml @@ -47,7 +47,7 @@ jobs: git show -s --format=raw HEAD docker buildx build \ -t $TAG \ - --cache-from=type=registry,ref=apache/superset-cache:3.10-slim-bookworm \ + --cache-from=type=registry,ref=apache/superset-cache:3.10-slim-trixie \ --target superset-node-ci \ . diff --git a/Dockerfile b/Dockerfile index 6dee6b31058c..b8cbc4270f28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ ###################################################################### # Node stage to deal with static asset construction ###################################################################### -ARG PY_VER=3.11.13-slim-bookworm +ARG PY_VER=3.11.13-slim-trixie # If BUILDPLATFORM is null, set it to 'amd64' (or leave as is otherwise). ARG BUILDPLATFORM=${BUILDPLATFORM:-amd64} @@ -29,7 +29,7 @@ ARG BUILD_TRANSLATIONS="false" ###################################################################### # superset-node-ci used as a base for building frontend assets and CI ###################################################################### -FROM --platform=${BUILDPLATFORM} node:20-bookworm-slim AS superset-node-ci +FROM --platform=${BUILDPLATFORM} node:20-trixie-slim AS superset-node-ci ARG BUILD_TRANSLATIONS ENV BUILD_TRANSLATIONS=${BUILD_TRANSLATIONS} ARG DEV_MODE="false" # Skip frontend build in dev mode @@ -64,7 +64,7 @@ RUN --mount=type=bind,source=./superset-frontend/package.json,target=./package.j --mount=type=bind,source=./superset-frontend/package-lock.json,target=./package-lock.json \ --mount=type=cache,target=/root/.cache \ --mount=type=cache,target=/root/.npm \ - if [ "$DEV_MODE" = "false" ]; then \ + if [ "${DEV_MODE}" = "false" ]; then \ npm ci; \ else \ echo "Skipping 'npm ci' in dev mode"; \ @@ -80,7 +80,7 @@ FROM superset-node-ci AS superset-node # Build the frontend if not in dev mode RUN --mount=type=cache,target=/root/.npm \ - if [ "$DEV_MODE" = "false" ]; then \ + if [ "${DEV_MODE}" = "false" ]; then \ echo "Running 'npm run ${BUILD_CMD}'"; \ npm run ${BUILD_CMD}; \ else \ @@ -91,11 +91,10 @@ RUN --mount=type=cache,target=/root/.npm \ COPY superset/translations /app/superset/translations # Build translations if enabled, then cleanup localization files -RUN if [ "$BUILD_TRANSLATIONS" = "true" ]; then \ +RUN if [ "${BUILD_TRANSLATIONS}" = "true" ]; then \ npm run build-translation; \ fi; \ - rm -rf /app/superset/translations/*/*/*.po; \ - rm -rf /app/superset/translations/*/*/*.mo; + rm -rf /app/superset/translations/*/*/*.[po,mo]; ###################################################################### @@ -106,10 +105,10 @@ FROM python:${PY_VER} AS python-base ARG SUPERSET_HOME="/app/superset_home" ENV SUPERSET_HOME=${SUPERSET_HOME} -RUN mkdir -p $SUPERSET_HOME +RUN mkdir -p ${SUPERSET_HOME} RUN useradd --user-group -d ${SUPERSET_HOME} -m --no-log-init --shell /bin/bash superset \ - && chmod -R 1777 $SUPERSET_HOME \ - && chown -R superset:superset $SUPERSET_HOME + && chmod -R 1777 ${SUPERSET_HOME} \ + && chown -R superset:superset ${SUPERSET_HOME} # Some bash scripts needed throughout the layers COPY --chmod=755 docker/*.sh /app/docker/ @@ -134,11 +133,10 @@ RUN --mount=type=cache,target=/root/.cache/uv \ . /app/.venv/bin/activate && /app/docker/pip-install.sh --requires-build-essential -r requirements/translations.txt COPY superset/translations/ /app/translations_mo/ -RUN if [ "$BUILD_TRANSLATIONS" = "true" ]; then \ +RUN if [ "${BUILD_TRANSLATIONS}" = "true" ]; then \ pybabel compile -d /app/translations_mo | true; \ fi; \ - rm -f /app/translations_mo/*/*/*.po; \ - rm -f /app/translations_mo/*/*/*.json; + rm -f /app/translations_mo/*/*/*.[po,json] ###################################################################### # Python APP common layer @@ -170,11 +168,11 @@ RUN mkdir -p \ ARG INCLUDE_CHROMIUM="false" ARG INCLUDE_FIREFOX="false" RUN --mount=type=cache,target=${SUPERSET_HOME}/.cache/uv \ - if [ "$INCLUDE_CHROMIUM" = "true" ] || [ "$INCLUDE_FIREFOX" = "true" ]; then \ + if [ "${INCLUDE_CHROMIUM}" = "true" ] || [ "${INCLUDE_FIREFOX}" = "true" ]; then \ uv pip install playwright && \ playwright install-deps && \ - if [ "$INCLUDE_CHROMIUM" = "true" ]; then playwright install chromium; fi && \ - if [ "$INCLUDE_FIREFOX" = "true" ]; then playwright install firefox; fi; \ + if [ "${INCLUDE_CHROMIUM}" = "true" ]; then playwright install chromium; fi && \ + if [ "${INCLUDE_FIREFOX}" = "true" ]; then playwright install firefox; fi; \ else \ echo "Skipping browser installation"; \ fi diff --git a/RELEASING/Dockerfile.from_local_tarball b/RELEASING/Dockerfile.from_local_tarball index 3794ed4c80ae..c56d75e87dc1 100644 --- a/RELEASING/Dockerfile.from_local_tarball +++ b/RELEASING/Dockerfile.from_local_tarball @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM python:3.10-slim-bookworm +FROM python:3.10-slim-trixie RUN useradd --user-group --create-home --no-log-init --shell /bin/bash superset diff --git a/RELEASING/Dockerfile.from_svn_tarball b/RELEASING/Dockerfile.from_svn_tarball index 33d0e9451b0b..889724863a5d 100644 --- a/RELEASING/Dockerfile.from_svn_tarball +++ b/RELEASING/Dockerfile.from_svn_tarball @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM python:3.10-slim-bookworm +FROM python:3.10-slim-trixie RUN useradd --user-group --create-home --no-log-init --shell /bin/bash superset diff --git a/RELEASING/Dockerfile.make_docs b/RELEASING/Dockerfile.make_docs index c4bca3bb3a89..e62faa89f8be 100644 --- a/RELEASING/Dockerfile.make_docs +++ b/RELEASING/Dockerfile.make_docs @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM python:3.10-slim-bookworm +FROM python:3.10-slim-trixie ARG VERSION RUN git clone --depth 1 --branch ${VERSION} https://github.com/apache/superset.git /superset diff --git a/RELEASING/Dockerfile.make_tarball b/RELEASING/Dockerfile.make_tarball index 4e701afd172f..e3163273a5e4 100644 --- a/RELEASING/Dockerfile.make_tarball +++ b/RELEASING/Dockerfile.make_tarball @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -FROM python:3.10-slim-bookworm +FROM python:3.10-slim-trixie RUN apt-get update -y RUN apt-get install -y \ diff --git a/docker-compose-light.yml b/docker-compose-light.yml index 70c4f6225d64..e60491136f8c 100644 --- a/docker-compose-light.yml +++ b/docker-compose-light.yml @@ -71,7 +71,7 @@ x-common-build: &common-build context: . target: ${SUPERSET_BUILD_TARGET:-dev} # can use `dev` (default) or `lean` cache_from: - - apache/superset-cache:3.10-slim-bookworm + - apache/superset-cache:3.10-slim-trixie args: DEV_MODE: "true" INCLUDE_CHROMIUM: ${INCLUDE_CHROMIUM:-false} diff --git a/docker-compose-non-dev.yml b/docker-compose-non-dev.yml index 78eb3c010dcf..5d221ab602c1 100644 --- a/docker-compose-non-dev.yml +++ b/docker-compose-non-dev.yml @@ -33,7 +33,7 @@ x-common-build: &common-build context: . target: dev cache_from: - - apache/superset-cache:3.10-slim-bookworm + - apache/superset-cache:3.10-slim-trixie services: redis: diff --git a/docker-compose.yml b/docker-compose.yml index 08b0c40701ca..38dc530e6ffd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,7 +36,7 @@ x-common-build: &common-build context: . target: ${SUPERSET_BUILD_TARGET:-dev} # can use `dev` (default) or `lean` cache_from: - - apache/superset-cache:3.10-slim-bookworm + - apache/superset-cache:3.10-slim-trixie args: DEV_MODE: "true" INCLUDE_CHROMIUM: ${INCLUDE_CHROMIUM:-false} diff --git a/docker/apt-install.sh b/docker/apt-install.sh index bd9152bebbd5..1c36353199ea 100755 --- a/docker/apt-install.sh +++ b/docker/apt-install.sh @@ -18,7 +18,7 @@ set -euo pipefail # Ensure this script is run as root -if [[ $EUID -ne 0 ]]; then +if [[ ${EUID} -ne 0 ]]; then echo "This script must be run as root" >&2 exit 1 fi @@ -42,7 +42,7 @@ echo -e "${GREEN}Installing packages: $@${RESET}" apt-get install -yqq --no-install-recommends "$@" echo -e "${GREEN}Autoremoving unnecessary packages...${RESET}" -apt-get autoremove -y +apt-get autoremove -yqq --purge echo -e "${GREEN}Cleaning up package cache and metadata...${RESET}" apt-get clean diff --git a/docker/pip-install.sh b/docker/pip-install.sh index 7deb4fa19a7d..74fd6c41333c 100755 --- a/docker/pip-install.sh +++ b/docker/pip-install.sh @@ -38,14 +38,14 @@ for arg in "$@"; do done # Install build-essential if required -if $REQUIRES_BUILD_ESSENTIAL; then +if ${REQUIRES_BUILD_ESSENTIAL}; then echo "Installing build-essential for package builds..." apt-get update -qq \ && apt-get install -yqq --no-install-recommends build-essential fi # Choose whether to use pip cache -if $USE_CACHE; then +if ${USE_CACHE}; then echo "Using pip cache..." uv pip install "${ARGS[@]}" else @@ -54,7 +54,7 @@ else fi # Remove build-essential if it was installed -if $REQUIRES_BUILD_ESSENTIAL; then +if ${REQUIRES_BUILD_ESSENTIAL}; then echo "Removing build-essential to keep the image lean..." apt-get autoremove -yqq --purge build-essential \ && apt-get clean \