ollama/examples/python-dockerit
Kim Hallberg 0be8baad2b
Update and Fix example models (#6065)
* Update example models

* Remove unused README.md
2024-07-29 23:56:37 -07:00
..
dockerit.py Update and Fix example models (#6065) 2024-07-29 23:56:37 -07:00
Modelfile rename dirs 2023-10-11 06:10:24 -07:00
README.md Update readmes, requirements, packagejsons, etc for all examples (#1452) 2023-12-22 09:10:41 -08:00
requirements.txt rename dirs 2023-10-11 06:10:24 -07:00

DockerIt

DockerIt is a tool to help you build and run your application in a Docker container. It consists of a model that defines the system prompt and model weights to use, along with a python script to then build the container and run the image automatically.

Running the Example

  1. Ensure you have the mattw/dockerit model installed:

    ollama pull mattw/dockerit
    
  2. Make sure Docker is running on your machine.

  3. Install the Python Requirements.

    pip install -r requirements.txt
    
  4. Run the example:

    python dockerit.py "simple postgres server with admin password set to 123"
    
  5. Enter the name you would like to use for your container image.

Caveats

This is a simple example. It's assuming the Dockerfile content generated is going to work. In many cases, even with simple web servers, it fails when trying to copy files that don't exist. It's simply an example of what you could possibly do.