How to Push Docker Image to Google Cloud Repository (GCR) (Easy steps!)

      Here’s how to push your local docker image to your GCR (Google Cloud Repository). You might want to use your own docker image later for your containerized app or kubernetes. For this research, I use Ubuntu 18.04.03 LTS Install gcloud, see the full instructions here : Once you’ve installed the gcloud, … Read more

Setup Kubernetes on Ubuntu 16.04

Summary This setup is supposedly to install the kubernetes on ubuntu machine with version 16.04 (64bit). I did this in the cloud and have worked perfectly. # whoami && pwd root /root # apt-get update # apt-get install -y apt-transport-https # curl -s | sudo apt-key add – # echo “deb kubernetes-xenial main” … Read more

Create docker image and push to AWS ECR

Image tag : test-image awsudo -u aws-profile aws ecr get-login –no-include-email –region ap-southeast-1 sudo docker build -t test-image . sudo docker tag codebuild:test-image sudo docker push  

Fix cannot access internet in your docker container

I use docker for testing environment. Somehow I found out that the docker container cannot access the internet and the solution is really simple: $ sudo ifconfig docker0 down $ sudo service docker restart $ sudo ifconfig docker0 up Or $ sudo vim /etc/default/docker DOCKER_OPTS=”–dns –dns –dns″ Which: in my localhost/laptop

Kubernetes cheatsheet

To list all deployments: kubectl get deployments –all-namespaces To delete deployment: kubectl delete -n NAMESPACE deployment DEPLOYMENT To get admin user token dashboard kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk ‘{print $1}’) Allow master to run pod kubectl taint nodes –all To join master node kubeadm … Read more

Docker command cheatsheet

docker build image $ sudo docker build -t image-name . docker to start a container from image $ sudo docker run -itd –name jenkins –publish 8080:8080 –publish 50000:50000 jenkins docker to get inside the container $ sudo docker exec -it jenkins bash docker stop container $ sudo docker stop image-id/name docker remove container $ sudo … Read more