# Replace dictionary in container

This guide shows how to replace a Hunspell dictionary in a Docker container and then create an image from the modified container. It is intended for users who are familiar with basic Docker commands.

1. **Connect to your machine with a running container.** Ensure you are connected to the machine where your Docker container is running.
2. **Upload the dictionary files to the container.** Use the following commands to upload your updated Hunspell files to the container:

   ```bash
   docker cp en_US.aff <container_id>:/en_US.aff
   docker cp en_US.dic <container_id>:/en_US.dic
   ```
3. **Replace the dictionary files.** Access your container and replace the existing dictionary files.

   ```bash
   docker exec -it <container_id> /bin/bash
   ```

   The Hunspell files are stored here:

   * `/var/lib/WebSpellChecker/Resources/Hunspell/en/`

   Replace `en_US.aff` and `en_US.dic`:

   ```bash
   mv /en_US.aff /var/lib/WebSpellChecker/Resources/Hunspell/en/en_US.aff
   mv /en_US.dic /var/lib/WebSpellChecker/Resources/Hunspell/en/en_US.dic
   ```
4. **Create an image of the container.** After making the changes, create an image of your container:

   ```bash
   docker commit <container_id>
   ```

   For a more detailed workflow, see how to [create an image from modified container](https://github.com/WebSpellChecker/wproofreader-docker#create-image-from-modified-docker-container).
5. **Verify the new image.** Confirm the creation of the new image. Look for the image in the list with a recent creation time.

   ```bash
   docker images
   ```
6. **(Optional) Tag the new image.** Optionally, you can tag the new image for easier identification:

   ```bash
   docker tag <image_id> image_with_new_hunspell_dict
   ```

{% hint style="warning" %}
Replace `container_id` and `image_id` with your specific container and image IDs.
{% endhint %}

<br>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wproofreader.com/v6.12.0/deployment/installation/docker/replace-dictionary-in-container.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
