> For the complete documentation index, see [llms.txt](https://docs.wproofreader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wproofreader.com/v6.12.0/deployment/installation/docker/replace-dictionary-in-container.md).

# 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>
