


docker run -d -p 5000:5000 - name registry registry:2ĭockerfile # start from Python 3.x base image FROM python:3.8-alpine RUN apk update update \\ & apk add apache2-utils \\ & apk add bash \\ & mkdir /pypi-server WORKDIR /pypi-server #creating packages directory and Authentication Directory RUN mkdir packages \\ & mkdir auth #Installing pypi server and pass lib module for authentication RUN python3 -m pip install pypiserver passlib COPY. Run container registry locally which will serve at port 5000, you can also use container registry of your choice it can be in Azure, AWS, GCP, docker hub, or private registry. Refer: All the code is committed to Github, use it!įor the server, we will use the public pypiserver package and host it on Kubernetes. Container Registry (ACR, ECR, GCR, Docker hub or local registry)įor this blog post, I am running Kubernetes locally using the docker for desktop (Mac) along with a locally hosted container registry to push and pull Docker images.Kubernetes Cluster (EKS, AKS, GKE or Minikube).We will use pypiserver from the public PyPI index and build a custom docker image and host the server in Kubernetes. In this post, we will see how to host and serve private Python packages in Kubernetes.

A private PyPI library would best serve such use cases. However, developers might need to host their own Python packages for personal projects or across one's organization. Most of us would have used the public PyPI registry to install popular Python libraries.
