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:

    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.

    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:

    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:

    docker commit <container_id>

    For a more detailed workflow, see how to create an image from modified containerarrow-up-right.

  5. Verify the new image. Confirm the creation of the new image. Look for the image in the list with a recent creation time.

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

    docker tag <image_id> image_with_new_hunspell_dict
circle-exclamation

Last updated

Was this helpful?