Running Minicli with Docker¶
Docker
is a tool for containerization. It's a lightweight, portable, and easy to use container runtime. It's designed to make it easier to run applications on a seperated environment, which is very useful when you want to run a lot of applications on a single machine without conflicts between packages and softwares.
Devopment Environment¶
We have a sandbox repository, which is a containerized version of Minicli. It's a nice starting point for you to try out the tool. You can find it at Minicli sandbox Github repository. Once you cloned the repository, you need to run the following commands to prepare your environment:
Bash | |
---|---|
Note: You must have Docker and Docker Compose installed on your machine to execute these commands.
After that, for you can run the previously configured command and your future custom commands, just run:
Bash | |
---|---|
Production?¶
If you want to distribute your Minicli app with Docker, you can create a custom Docker image for that. You will need a Dockerfile and a entrypoint bash script. You can use the Dockerfile in the sandbox repository and just modify it or write your own. Below you will see the sandbox Dockerfile with the changes you need to make.
The Dockerfile:
The entrypoint script:
Note: You have to create these files in the same directory as your project.
now, you can create a Docker image based on the sandbox Dockerfile. You can use the following command to create the image:
Bash | |
---|---|
Finally, you can run the commands of your app with minicli using the command below:
Bash | |
---|---|
Follow the instructions in the Docker Hub to publish your image.