From 332413a00c1db12f04b762dec2ad5e60440d3eba Mon Sep 17 00:00:00 2001 From: Alex Streed Date: Sun, 9 Feb 2025 15:11:36 -0600 Subject: [PATCH] Use newer `npm` version in Docker UI build (#17064) --- .github/workflows/docker-images.yaml | 1 + .github/workflows/time-docker-build.yaml | 15 +++++++++++++-- Dockerfile | 5 +---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-images.yaml b/.github/workflows/docker-images.yaml index 500db40fffca..6ef293ceef11 100644 --- a/.github/workflows/docker-images.yaml +++ b/.github/workflows/docker-images.yaml @@ -20,6 +20,7 @@ jobs: runs-on: ubuntu-latest environment: ${{ github.event_name == 'release' && github.event.release.prerelease && 'pre-release' || github.event_name == 'release' && 'prod' || 'dev' }} strategy: + fail-fast: false matrix: flavor: - "" diff --git a/.github/workflows/time-docker-build.yaml b/.github/workflows/time-docker-build.yaml index 83da8547d0a8..323830a112fe 100644 --- a/.github/workflows/time-docker-build.yaml +++ b/.github/workflows/time-docker-build.yaml @@ -20,6 +20,9 @@ jobs: with: fetch-depth: 0 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -42,7 +45,11 @@ jobs: id: base_build_time run: | start_time=$(date +%s) - DOCKER_BUILDKIT=1 docker build . --no-cache --progress=plain + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --no-cache \ + --progress=plain \ + . end_time=$(date +%s) base_time=$((end_time - start_time)) echo "base_time=$base_time" >> $GITHUB_OUTPUT @@ -65,7 +72,11 @@ jobs: id: build_time run: | start_time=$(date +%s) - DOCKER_BUILDKIT=1 docker build . --no-cache --progress=plain + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --no-cache \ + --progress=plain \ + . end_time=$(date +%s) build_time=$((end_time - start_time)) echo "build_time=$build_time" >> $GITHUB_OUTPUT diff --git a/Dockerfile b/Dockerfile index 55202b594c5a..d0ff14ac7690 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ ARG NODE_VERSION=18.18.0 ARG EXTRA_PIP_PACKAGES="" # Build the UI distributable. -FROM node:${NODE_VERSION}-bullseye-slim AS ui-builder +FROM --platform=$BUILDPLATFORM node:${NODE_VERSION}-bullseye-slim AS ui-builder WORKDIR /opt/ui @@ -24,9 +24,6 @@ RUN apt-get update && \ chromium \ && apt-get clean && rm -rf /var/lib/apt/lists/* -# Install a newer npm to avoid esbuild errors -RUN npm install -g npm@8 - # Install dependencies separately so they cache COPY ./ui/package*.json ./ RUN npm ci