Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/build-push-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:

env:
DOCKER_ORG: nebari
GPU_BASE_IMAGE: nvidia/cuda:12.8.1-base-ubuntu24.04
GPU_BASE_IMAGE: nvidia/cuda:12.8.1-runtime-ubuntu24.04
GPU_IMAGE_SUFFIX: gpu
BASE_IMAGE: ubuntu:24.04

Expand Down Expand Up @@ -87,6 +87,7 @@ jobs:
echo "GPU Platform Matrix"
echo "BASE_IMAGE=$GPU_BASE_IMAGE" >> $GITHUB_ENV
echo "IMAGE_SUFFIX=-$GPU_IMAGE_SUFFIX" >> $GITHUB_ENV
echo "GPU=true" >> $GITHUB_ENV

- name: "Generate Docker images tags 🏷️"
id: meta
Expand Down Expand Up @@ -119,5 +120,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: BASE_IMAGE=${{ env.BASE_IMAGE }}
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
GPU=${{ env.GPU }}
platforms: linux/amd64,linux/arm64
2 changes: 1 addition & 1 deletion .github/workflows/test-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
env:
DOCKER_ORG: nebari
GITHUB_SHA: ${{ github.sha }}
GPU_BASE_IMAGE: nvidia/cuda:12.8.1-base-ubuntu24.04
GPU_BASE_IMAGE: nvidia/cuda:12.8.1-runtime-ubuntu24.04
GPU_IMAGE_SUFFIX: gpu
BASE_IMAGE: ubuntu:24.04

Expand Down
17 changes: 10 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
FROM ubuntu:24.04 AS builder
ARG BASE_IMAGE=ubuntu:24.04

Check failure

Code scanning / Trivy

Image user should not be 'root' High

Artifact: Dockerfile
Type: dockerfile
Vulnerability DS002
Severity: HIGH
Message: Specify at least 1 USER command in Dockerfile with non-root user as argument
Link: DS002
FROM ${BASE_IMAGE} AS builder

Check warning on line 2 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-test-images (jupyterlab, gpu)

Always tag the version of an image explicitly
LABEL MAINTAINER="Nebari development team"

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \

Check warning on line 5 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-test-images (jupyterlab, gpu)

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y --no-install-recommends \
wget \
Expand Down Expand Up @@ -29,9 +30,10 @@
--mount=type=cache,target=/root/.cache/pip,sharing=locked \
/opt/scripts/install-conda-environment.sh /opt/dask-worker/environment.yaml 'false'

ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib64
ENV NVIDIA_PATH=/usr/local/nvidia/bin
ENV PATH="$NVIDIA_PATH:$PATH"
ARG GPU=false
ENV LD_LIBRARY_PATH=${GPU:+/usr/local/nvidia/lib64}
ENV NVIDIA_PATH=${GPU:+/usr/local/nvidia/bin}
ENV PATH=${GPU:+/usr/local/nvidia/bin:}${PATH}

COPY dask-worker /opt/dask-worker
RUN /opt/dask-worker/postBuild
Expand Down Expand Up @@ -71,7 +73,7 @@
# Set timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \

Check warning on line 76 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-test-images (jupyterlab, gpu)

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y --no-install-recommends \
locales \
Expand All @@ -90,14 +92,15 @@

# ========== jupyterlab install ===========
FROM intermediate AS jupyterlab
ARG GPU=false
ENV CONDA_DIR=/opt/conda \
DEFAULT_ENV=default \
LD_LIBRARY_PATH=/usr/local/nvidia/lib64 \
NVIDIA_PATH=/usr/local/nvidia/bin
LD_LIBRARY_PATH=${GPU:+/usr/local/nvidia/lib64} \
NVIDIA_PATH=${GPU:+/usr/local/nvidia/bin}

ENV PATH="$NVIDIA_PATH:$PATH"
ENV PATH=${GPU:+/usr/local/nvidia/bin:}${PATH}

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \

Check warning on line 103 in Dockerfile

View workflow job for this annotation

GitHub Actions / build-test-images (jupyterlab, gpu)

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y --no-install-recommends \
zsh \
Expand Down
Loading