> ## Documentation Index
> Fetch the complete documentation index at: https://wb-21fd5541-serverless-sft-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# wandb docker

Run your code in a docker container.

W\&B docker lets you run your code in a docker image ensuring wandb is configured. It adds the WANDB\_DOCKER and WANDB\_API\_KEY environment variables to your container and mounts the current directory in /app by default. You can pass additional args which will be added to `docker run` before the image name is declared, we'll choose a default image for you if one isn't passed:

```sh theme={null}
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"
```

By default, we override the entrypoint to check for the existence of wandb and install it if not present. If you pass the --jupyter flag we will ensure jupyter is installed and start jupyter lab on port 8888. If we detect nvidia-docker on your system we will use the nvidia runtime. If you just want wandb to set environment variable to an existing docker run command, see the wandb docker-run command.

docker 컨테이너에서 코드를 실행하세요.

W\&B docker를 사용하면 wandb가 설정된 상태로 docker 이미지에서 코드를 실행할 수 있습니다. 이 코맨드는 `WANDB_DOCKER` 및 `WANDB_API_KEY` 환경 변수를 컨테이너에 추가하고, 기본적으로 현재 디렉토리를 `/app`에 마운트합니다. 이미지 이름이 선언되기 전에 `docker run`에 추가될 추가 인수를 전달할 수 있으며, 이미지를 지정하지 않으면 기본 이미지가 선택됩니다.

```sh theme={null}
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"
```

기본적으로 W\&B는 entrypoint를 오버라이드하여 wandb의 존재 여부를 확인하고, 설치되어 있지 않으면 설치합니다. `--jupyter` 플래그를 전달하면 jupyter가 설치되었는지 확인하고 8888 포트에서 jupyter lab을 시작합니다. 시스템에서 nvidia-docker가 감지되면 nvidia 런타임을 사용합니다. 기존의 docker run 코맨드에 wandb 환경 변수만 설정하고 싶다면 `wandb docker-run` 코맨드를 참조하세요.

## Usage

```bash theme={null}
wandb docker [DOCKER_RUN_ARGS] [DOCKER_IMAGE] [OPTIONS]
```

## Arguments

| 인수                | 설명    | 필수 여부 |
| :---------------- | :---- | :---- |
| `DOCKER_RUN_ARGS` | 설명 없음 | No    |
| `DOCKER_IMAGE`    | 설명 없음 | No    |

## Options

| 옵션          | 설명                                                                     |
| :---------- | :--------------------------------------------------------------------- |
| `--nvidia`  | nvidia 런타임을 사용합니다. nvidia-docker가 있으면 기본값으로 nvidia를 사용합니다 (기본값: False) |
| `--digest`  | 이미지 digest를 출력하고 종료합니다 (기본값: False)                                    |
| `--jupyter` | 컨테이너에서 jupyter lab을 실행합니다 (기본값: False)                                 |
| `--dir`     | 컨테이너 내에서 코드를 마운트할 디렉토리 (기본값: /app)                                     |
| `--no-dir`  | 현재 디렉토리를 마운트하지 않습니다 (기본값: False)                                       |
| `--shell`   | 컨테이너를 시작할 쉘 (기본값: /bin/bash)                                           |
| `--port`    | jupyter를 바인딩할 호스트 포트 (기본값: 8888)                                       |
| `--cmd`     | 컨테이너에서 실행할 코맨드                                                         |
| `--no-tty`  | tty 없이 코맨드를 실행합니다 (기본값: False)                                         |
