Skip to main content

Usage

docker [OPTIONS] [DOCKER_RUN_ARGS]... [DOCKER_IMAGE]

Description

Run code in a Docker container with W&B configured. Start a Docker container, inject the WANDB_DOCKERs environment variable, and mount the current working directory at /app by default. Inject WANDB_API_KEY if logged in. Override the container entrypoint to ensure wandb is installed. Pass additional arguments to insert them into docker run before the image name. Use a default image if none is specified. Use --jupyter to install and start JupyterLab on port 8888. Enable the NVIDIA runtime automatically if NVIDIA Docker is available on the host. Requires Docker to be installed and running on the host machine. To inject W&B environment variables into an existing docker run command without modifying the entrypoint, use wandb docker-run. For example, to run the default image and mount a dataset into the container:
wandb docker -v /mnt/dataset:/app/data
To run a default image and start JupyterLab:
wandb docker -v /mnt/dataset:/app/data --jupyter
To run a GPU-enabled image with a training command:
wandb docker wandb/deepo:keras-gpu --no-tty --cmd "python train.py"

Arguments

NameDefaultType
docker_run_argsSTRFalse
docker_imageSTRFalse

Options

FlagTypeDescription
--nvidiaBOOL FlagUse the nvidia runtime, defaults to nvidia if nvidia-docker is present. Default: False
--digestBOOL FlagOutput the image digest and exit. Default: False
--jupyterBOOL FlagRun jupyter lab in the container. Default: False
--dirSTRWhich directory to mount the code in the container. Default: /app
--no-dirBOOL FlagDon’t mount the current directory. Default: False
--shellSTRThe shell to start the container with. Default: /bin/bash
--portSTRThe host port to bind jupyter on. Default: 8888
--cmdSTRThe command to run in the container. Default: None
--no-ttyBOOL FlagRun the command without a tty. Default: False