Rails with Docker cheat sheet
rails new command with docker
$ docker run --rm -v $(pwd):/app bitnami/rails:latest rails new my_app --database mysql
https://docs.bitnami.com/kubernetes/how-to/deploy-rails-application-kubernetes-helm/
minikube version minikube start kubectl version kubectl cluster-info kubectl get nodes kubectl get deployments kubectl run kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1 --port=8080
kubectl proxy curl http://localhost:8001/version
export POD_NAME=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}') echo Name of the Pod: $POD_NAME echo $POD_NAME hello-node-7657b78bd9-m66kh kubernetes-bootcamp-b94cb9bff-65rqg nginx-deployment-6dd86d77d-ffzp9 nginx-deployment-6dd86d77d-zk95r
curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy/
$ kubectl get pods NAME READY STATUS RESTARTS AGE hello-node-7657b78bd9-m66kh 0/1 CrashLoopBackOff 1967 62d kubernetes-bootcamp-b94cb9bff-65rqg 1/1 Running 0 66m nginx-deployment-6dd86d77d-ffzp9 1/1 Running 2 62d nginx-deployment-6dd86d77d-zk95r 1/1 Running 2 62d
helm install
$ brew install kubernetes-helm https://matthewpalmer.net/kubernetes-app-developer/articles/how-to-install-helm-mac.html $ helm create my-rails-app $ cd my-rails-app $ kubectl create secret generic db-user-pass --from-literal=password=mysecretpass secret/db-user-pass created $ kubectl create secret generic db-user --from-literal=username=postgres secret/db-user created $ kubectl create -f postgres.yaml $ kubectl get pods -w NAME READY STATUS RESTARTS AGE postgres-47mxp 1/1 Running 0 11m
Read
https://docs.bitnami.com/kubernetes/how-to/deploy-rails-application-kubernetes-helm/
https://blog.cosmocloud.co/rails-on-kubernetes-part-2/
https://github.com/tzumby/rails-on-kubernetes
https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/
https://kubernetes.io/ko/docs/reference/kubectl/cheatsheet/
https://cheatsheet.dennyzhang.com/cheatsheet-minikube-a4
Google Container Registry (GCR)
https://cloud.google.com/container-registry/
https://cloud.google.com/container-registry/docs/quickstart
https://blog.cosmocloud.co/rails-on-kubernetes-part-2/
https://github.com/tzumby/rails-on-kubernetes
https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/
https://kubernetes.io/ko/docs/reference/kubectl/cheatsheet/
https://cheatsheet.dennyzhang.com/cheatsheet-minikube-a4
Google Container Registry (GCR)
https://cloud.google.com/container-registry/
https://cloud.google.com/container-registry/docs/quickstart
$ gcloud auth configure-docker The following settings will be added to your Docker config file located at [/Users/rhee/.docker/config.json]: { "credHelpers": { "gcr.io": "gcloud", "us.gcr.io": "gcloud", "eu.gcr.io": "gcloud", "asia.gcr.io": "gcloud", "staging-k8s.gcr.io": "gcloud", "marketplace.gcr.io": "gcloud" } } Do you want to continue (Y/n)? Y Docker configuration file updated. Updates are available for some Cloud SDK components. To install them, please run: $ gcloud components update To take a quick anonymous survey, run: $ gcloud alpha survey
$ docker tag quickstart-image gcr.io/[PROJECT-ID]/quickstart-image:tag1
Docker push
docker.io
docker tag tzumby/rails-app:latest x1wins/rails-app:latest docker push x1wins/rails-app:latest
google container registry gcr
docker tag tzumby/rails-app:latest gcr.io/[project_id]/rails-app:latest gcloud docker -- push gcr.io/[project_id]/rails-app:latest