> For the complete documentation index, see [llms.txt](https://dockgispy.gitbook.io/dockgispy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dockgispy.gitbook.io/dockgispy/build-your-own-image-from-scratch.md).

# Build your own Image from Scratch

If you wish to build your image, probably because the images do not have modules you need for your workflow or you want to strip down the installed modules. You can follow the steps below to build your image from scratch.

* Clone the repository with this command `git clone https://github.com/Idowuilekura/dock_gis_py.git`
* Change your directory into the cloned folder which is `dock_gis_py` with this command `cd dock_gis_py`
* You can change the directory to any of the folder tags of your choice such as `dockgispysmallest`.
* Once you are in the folder of your choice, you will see a file named `requirements.txt`. To learn more about the importance of `requirements.txt` check [here](https://pip.pypa.io/en/stable/reference/requirements-file-format/). You need to open the `requirements.txt` and remove or add the Python GIS module of your choice.
* Once you are done editing, save the file. Ensure you confirm that your changes are saved.
* The next step is to build your docker image. To build your image type this command `docker build -t name_of_your_image` e.g if you wish to use `dockgispy` as the name of your new image then run this command `docker build -t dockgispy`. The image will be automatically built with the speed of light, thanks to `UV` 😉 for installing the Python packages.
* Once you have built the image, you can run this command `docker image ls` and see your newly built image.
* The last step is to run your image by using `docker run -v path_to_your_local_folder:/app -p your_desired_port:8888 dockgispy`. Assume your newly built image is `dockgispy`. You can also use docker-compose, replace the image with your image name in the content shown below, save the content into a file and run `docker compose up`.

  ```
  services:
  app:
    image: your_image_name
    container_name: your_preferred_container_name
    # environment:
    #   - IDE_SET=lab
    ports:
      - "8000:8888"
    volumes:
      - ./app:/app
  ```
