Skip to content

Instantly share code, notes, and snippets.

@allbarbos
allbarbos / Dockerfile.flags
Last active January 24, 2022 14:49
Golang image docker
# Remove Flags
FROM golang:1.14.4-alpine AS builder
WORKDIR /go/src/github.com/seu-repo/api/
COPY . .
RUN CGO_ENABLED=0 GOOS=linux \
go build -a -installsuffix cgo -ldflags="-s -w" -o web_api ./main.go
@allbarbos
allbarbos / kubectl
Created June 19, 2020 23:24
k8s hands on - comandos
kubectl version --client
kubectl config get-contexts
kubectl config use-context minikube
kubectl create -f <yaml>
kubectl get <pod | deployment>
kubectl describe pods
@allbarbos
allbarbos / Minikube
Created June 23, 2020 20:46
Minikube
// inicia o Minikube
minikube start
// iniciar o Minikube com uma versão especifica do Kubernetes
minikube start --kubernetes-version="v1.16"
// acessar o dashboard do Kubernetes em execução
minikube dashboard
// status do Minikube
@allbarbos
allbarbos / Kubectl
Last active March 23, 2023 02:22
Kubectl
k get pods -n <NAMESPACE_NAME>
# RECURSOS
k top pod <POD_NAME> -n <NAMESPACE_NAME> --containers
k top pod -n <NAMESPACE_NAME>
# LOG
k logs <POD_NAME> -n <NAMESPACE_NAME>
@allbarbos
allbarbos / git
Last active October 6, 2020 18:52
# delete branch local
git branch -d the_local_branch
# delete branch remota
git push origin :the_remote_branch
git push origin --delete the_remote_branch
# atualizar referências dos branches local com remote
git fetch --prune --all
# parar todos os containers
docker stop $(docker ps -a -q)
# remover todos os containers
docker rm -f $(docker ps -a -q)
# remover todas as imagens
docker rmi -f $(docker images -a -q)
# remover todos os containers e imagens
@allbarbos
allbarbos / tests.yml
Created July 26, 2020 19:58
Github Actions Cypress
# .github/workflows/tests.yml
name: Tests
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps: