> For the complete documentation index, see [llms.txt](https://docs.zingg.ai/zingg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zingg.ai/zingg/versions/community-v0.3.3/stepbystep/installation/workingwithdocker.md).

# Working with Docker Image

Running Zingg in Docker container is straightforward. Run following commands to get into the container.

```
docker pull zingg/zingg:0.3.3
docker run -it zingg/zingg:0.3.3 bash
```

## Sharing custom data and config files

However, note that once docker container is stopped, all the work done in that session is lost. If we want to use custom data or persist the generated model or data files, we have to use **Volumes** or **Bind mount** to share files between the two.

```
docker run -v <local-location>:<container-location> -it zingg/zingg:0.3.3 bash
```

The **\<local-location>** directory from host will get mounted inside container at **\<container-location>**. Any file written inside this directory will persist on host machine and can be reused in new container instance later.

## Zingg configurations using shared location

The **zinggDir** location where model inforamtion is stored may use shared location. In fact, any oft-editable file such as config.json should be kept in this location only.

```
zingg.sh --phase label --conf config.json --zinggDir /location
```

Similarly, the output and data dir [configurations](https://github.com/zinggAI/zingg/blob/0.3.3/docs/setup/setup/configuration.md) inside config.json can be made using shared location. Please ensure that the running user has access permissions for this location.

## File read/write permissions

A docker image is preferred to run with non-root user. By default, the zingg container runs with uid '1001'. A valid 'uid' can be passed through command line in order to run the container with that userid. This will enable the user to have requisite permissions to create/read/write files in shared location.

```
$ id 
uid=1000(abc) gid=1000(abc) groups=1000(abc)
$ docker run -u <uid> -it zingg/zingg:0.3.3 bash
```

## Copying files To and From the Container

A quick alternative to **Volume/bind Mount** is to just copy necessary files to and forth between the host and the container.

One specific file/directory can be copied TO and FROM the container. e.g.

```
$ docker cp foo.txt <container_id>:/foo.txt
$ docker cp <container_id>:/foo.txt foo.txt
```

The container id of the running instance can be found using below command.

```
$ docker ps
```

To know more about Docker, please refer to official [docker documentation](https://docs.docker.com/)

## Running Zingg within the docker image

Please follow the [Step By Step guide](https://github.com/zinggAI/zingg/blob/0.3.3/docs/setup/stepByStep.md) to run Zingg commands inside the container.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zingg.ai/zingg/versions/community-v0.3.3/stepbystep/installation/workingwithdocker.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
