Recommended Driver >=520.61.05

TensorFlow 2.14.0 + CUDA 11.8

Generate a production-ready Dockerfile with verified compatibility

Configuration Summary

Framework
TensorFlow 2.14.0
CUDA Version
11.8
Python Support
3.9, 3.10, 3.11
Min Driver
>=520.61.05
Install Command
pip install tensorflow==2.14.0

What's in TensorFlow 2.14.0

  • Classic tf.keras API
  • Wide library ecosystem support
  • Proven production stability

Best For

Use Cases

  • Legacy system maintenance
  • Maximum third-party compatibility
  • Enterprise systems with version locks

CUDA 11.8 Advantages

  • T4, V100, and older GPUs
  • Maximum compatibility
  • Cost-effective inference

Limitations: Missing newer CUDA optimizations

Generate Dockerfile

Configuration

Local GPU or CPU environment

Requires NVIDIA Driver >=520.61.05
Dockerfile
1# syntax=docker/dockerfile:1
2# ^ Required for BuildKit cache mounts and advanced features
3
4# Generated by DockerFit (https://tools.eastondev.com/docker)
5# TENSORFLOW 2.14.0 + CUDA 11.8 | Python 3.11
6# Multi-stage build for optimized image size
7
8# ==============================================================================
9# Stage 1: Builder - Install dependencies and compile
10# ==============================================================================
11FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 AS builder
12
13# Build arguments
14ARG DEBIAN_FRONTEND=noninteractive
15
16# Environment variables
17ENV PYTHONUNBUFFERED=1
18ENV PYTHONDONTWRITEBYTECODE=1
19ENV TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6"
20
21# Install Python 3.11 from deadsnakes PPA (Ubuntu 22.04)
22RUN apt-get update && apt-get install -y --no-install-recommends \
23 software-properties-common \
24 && add-apt-repository -y ppa:deadsnakes/ppa \
25 && apt-get update && apt-get install -y --no-install-recommends \
26 python3.11 \
27 python3.11-venv \
28 python3.11-dev \
29 build-essential \
30 git
31 && rm -rf /var/lib/apt/lists/*
32
33# Create virtual environment
34ENV VIRTUAL_ENV=/opt/venv
35RUN python3.11 -m venv $VIRTUAL_ENV
36ENV PATH="$VIRTUAL_ENV/bin:$PATH"
37
38# Upgrade pip
39RUN pip install --no-cache-dir --upgrade pip setuptools wheel
40
41# Install TensorFlow with BuildKit cache
42RUN --mount=type=cache,target=/root/.cache/pip \
43 pip install tensorflow==2.14.0
44
45# Install project dependencies
46COPY requirements.txt .
47RUN --mount=type=cache,target=/root/.cache/pip \
48 pip install -r requirements.txt
49
50# ==============================================================================
51# Stage 2: Runtime - Minimal production image
52# ==============================================================================
53FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04 AS runtime
54
55# Labels
56LABEL maintainer="Generated by DockerFit"
57LABEL version="2.14.0"
58LABEL description="TENSORFLOW 2.14.0 + CUDA 11.8"
59
60# Environment variables
61ENV PYTHONUNBUFFERED=1
62ENV PYTHONDONTWRITEBYTECODE=1
63ENV NVIDIA_VISIBLE_DEVICES=all
64ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
65
66# Install Python 3.11 runtime from deadsnakes PPA (Ubuntu 22.04)
67RUN apt-get update && apt-get install -y --no-install-recommends \
68 software-properties-common \
69 && add-apt-repository -y ppa:deadsnakes/ppa \
70 && apt-get update && apt-get install -y --no-install-recommends \
71 python3.11 \
72 libgomp1
73 && apt-get remove -y software-properties-common \
74 && apt-get autoremove -y \
75 && rm -rf /var/lib/apt/lists/*
76
77# Create non-root user for security
78ARG USERNAME=appuser
79ARG USER_UID=1000
80ARG USER_GID=$USER_UID
81RUN groupadd --gid $USER_GID $USERNAME \
82 && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
83
84# Copy virtual environment from builder
85COPY --from=builder --chown=$USERNAME:$USERNAME /opt/venv /opt/venv
86ENV VIRTUAL_ENV=/opt/venv
87ENV PATH="$VIRTUAL_ENV/bin:$PATH"
88
89# Set working directory
90WORKDIR /app
91
92# Copy application code
93COPY --chown=$USERNAME:$USERNAME . .
94
95# Switch to non-root user
96USER $USERNAME
97
98# Expose port
99EXPOSE 8000
100
101# Default command
102CMD ["python", "main.py"]
🚀 Recommended

High-Performance GPU Cloud

Deploy your Docker containers with powerful NVIDIA GPUs. A100/H100 available, 32+ global locations.

  • NVIDIA A100/H100 GPU instances
  • Hourly billing, starting at $0.004/h
  • 32+ global data centers
  • One-click container & bare metal deployment
🎁 Deploy Now

Frequently Asked Questions

What NVIDIA driver version do I need?

For TensorFlow 2.14.0 with CUDA 11.8, you need NVIDIA driver version >=520.61.05 or higher.

Run nvidia-smi to check your current driver version.

How do I install TensorFlow with CUDA support?

TensorFlow 2.14.0 uses the following installation command:

pip install tensorflow==2.14.0

Since TensorFlow 2.15+, CUDA libraries are bundled via tensorflow[and-cuda].

How do I verify GPU access in the container?

After building your image, run:

docker run --gpus all your-image python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

This should show available GPU devices.