Dock2Kube is a Python tool designed to create local Docker images ready for use with k3s Kubernetes from Dockerfiles.
Dock2Kube simplifies the process of creating local Docker images tailored for k3s Kubernetes. It automates image building, tagging, and management, enabling faster development cycles and smoother integration with k3s deployments.
- Efficient Image Building: Quickly build Docker images from Dockerfiles.
- Automatic Tagging: Automatically tag images with versioning.
- Seamless k3s Integration: Easily manage and use images locally with k3s Kubernetes.
- Docker installed on your machine.
- Python 3.x installed.
-
Clone this repository:
git clone https://github.com/gespel/Dock2Kube.git
-
Navigate to the cloned directory:
cd Dock2Kube
-
Install the required Python packages:
pip install -r requirements.txt
-
Write your Dockerfile(s) for your application(s).
-
Run the
dock2kube.py
script:python dock2kube.py
-
The script will build the Docker image and tag it with a version based on the current date and time.
-
Start your k3s Kubernetes cluster and use the local images with your deployments.
Let's say you have a simple Dockerfile for a Node.js application:
# Dockerfile
FROM node:14-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
CMD ["npm", "start"]
To build this Dockerfile with Dock2Kube:
python dock2kube.py
This will build the image and tag it with a version.
Contributions are welcome! Feel free to submit issues and pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.