Skip to main content
GitHub source Run your code in a docker container. Run your program inside a Docker image with W&B configured. Set the WANDB_DOCKER and WANDB_API_KEY environment variables in the container and mount the current working directory at /app by default. Pass additional arguments to insert them into docker run before the image name. If you do not specify an image, select a default image automatically.
wandb docker -v /mnt/dataset:/app/data
wandb docker gcr.io/kubeflow-images-public/tensorflow-1.12.0-notebook-cpu:v0.4.0 --jupyter
wandb docker wandb/deepo:keras-gpu --no-tty --cmd "python train.py --epochs=5"
Override the container entrypoint by default to ensure wandb is installed. If you pass --jupyter, ensure Jupyter is installed and start JupyterLab on port 8888. If NVIDIA Docker is available, use the NVIDIA runtime automatically. To set W&B environment variables for an existing docker run command without modifying the entrypoint, use wandb docker-run.

Usage

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

Arguments

docker_run_args

NameDefaultType
docker_run_argsNoneSTRING

docker_image

NameDefaultType
docker_imageNoneSTRING

Options

nvidia

Use the nvidia runtime, defaults to nvidia if nvidia-docker is present
FlagDefaultType
--nvidiaFalseBOOL

digest

Output the image digest and exit
FlagDefaultType
--digestFalseBOOL

jupyter

Run jupyter lab in the container
FlagDefaultType
--jupyterFalseBOOL

dir

Which directory to mount the code in the container
FlagDefaultType
--dir/appSTRING

no_dir

Don’t mount the current directory
FlagDefaultType
--no-dirFalseBOOL

shell

The shell to start the container with
FlagDefaultType
--shell/bin/bashSTRING

port

The host port to bind jupyter on
FlagDefaultType
--port8888STRING

cmd

The command to run in the container
FlagDefaultType
--cmdNoneSTRING

no_tty

Run the command without a tty
FlagDefaultType
--no-ttyFalseBOOL

help

Show this message and exit.
FlagDefaultType
--helpFalseBOOL

CLI Help

Usage: docker [OPTIONS] [DOCKER_RUN_ARGS]... [DOCKER_IMAGE]

  Run your code in a docker container.

  Run your program inside a Docker image with W&B configured. Set the
  ``WANDB_DOCKER`` and ``WANDB_API_KEY`` environment variables in the
  container and mount the current working directory at ``/app`` by default.

  Pass additional arguments to insert them into ``docker run`` before the
  image name. If you do not specify an image, select a default image
  automatically.

  ```sh wandb docker -v /mnt/dataset:/app/data wandb docker gcr.io/kubeflow-
  images-public/tensorflow-1.12.0-notebook-cpu:v0.4.0 --jupyter wandb docker
  wandb/deepo:keras-gpu --no-tty --cmd "python train.py --epochs=5" ```

  Override the container entrypoint by default to ensure ``wandb`` is
  installed. If you pass ``--jupyter``, ensure Jupyter is installed and start
  JupyterLab on port 8888.

  If NVIDIA Docker is available, use the NVIDIA runtime automatically.

  To set W&B environment variables for an existing ``docker run`` command
  without modifying the entrypoint, use ``wandb docker-run``.

Options:
  --nvidia / --no-nvidia    Use the nvidia runtime, defaults to nvidia if
                            nvidia-docker is present
  --digest                  Output the image digest and exit
  --jupyter / --no-jupyter  Run jupyter lab in the container
  --dir TEXT                Which directory to mount the code in the container
  --no-dir                  Don't mount the current directory
  --shell TEXT              The shell to start the container with
  --port TEXT               The host port to bind jupyter on
  --cmd TEXT                The command to run in the container
  --no-tty                  Run the command without a tty
  --help                    Show this message and exit.