1. Install docker on Ubuntu
- sudo apt-get update
- sudo apt-get upgrade
- follow these steps
- sudo systemctl start docker.service
- sudo systemctl enable docker.service
- sudo docker version
- Run docker without sudo: sudo usermod -aG docker [USER]
- After 7 you need: reboot
- docker search [name] -> thats for searching, example docker search nginx
- docker run hello-world
2. Install Kubernetes on ubuntu
Follow these steps. Important: before the command “sudo apt install kubeadm kubelet kubectl” run again “sudo apt-get update”
Nick Chapsas: How to deploy .NET apps to Kubernetes
- Create .NET project on VS
- Right click project -> Add… -> Docker support -> Linux
- Move Dockerfile out of project
- docker build -t johndoe/testapi:1.0.0 .
explain1: <dockerhubusername>/<dockerhubrepo>:version
explain2: . is the location of the folder - docker push johndoe/testapi:1.0.0
- Then you go to Kubernetes and select the public or private DockerHub Repo and it works
Other sources:
How to Host .NET Core Applications in VPS Using Docker: Link
Run Docker Containers in Oracle Cloud free: Link