Categories
docker sql

Docker: MySQL

https://hub.docker.com/r/mysql/mysql-server/ Download docker pull mysql/mysql-server:latest Create Option 1 – docker run docker run -d \ –name mysql-itsmetommy \ -p 3306:3306 \ –env=”MYSQL_ROOT_PASSWORD=password” \ mysql/mysql-server:latest Option 2 – docker-compose cat <<EOF > docker-compose.yml version: ‘3.8’ services: db: image: mysql:latest restart: always environment: MYSQL_DATABASE: ‘db’ # Optional user account MYSQL_USER: ‘tommy’ # Password for optional user account […]

Categories
docker

Push to Docker Hub using GitHub Actions

Knock-knock! Who’s there? Jenkins. Jenkins who? jk 🤣 Links https://docs.github.com/en/actions https://github.com/actions https://github.com/marketplace (think of it as an alternative to Jenkins plugins) https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions https://lab.github.com/githubtraining/github-actions:-publish-to-github-packages Create & clone repo Create a GitHub repository. Clone your repository and cd into it. git clone git@github.com:itsmetommy/github-actions.git && cd github-actions Create secrets Settings → Secrets Click New repository secret. Create two secrets. Create DOCKER_USERNAME. […]

Categories
docker

Docker: PostgreSQL

https://hub.docker.com/_/postgres Download docker pull postgres Create Option 1 – docker run docker run -d \ –name postgres-itsmetommy \ -e POSTGRES_PASSWORD=12345 \ -p 5432:5432 \ postgres Option 2 – docker-compose cat <<EOF > docker-compose.yml version: ‘3’services: postgres: image: postgres environment: POSTGRES_PASSWORD: “12345” ports: – “5432:5432” container_name: postgres-itsmetommy EOF Create. docker-compose up -d Logs. docker-compose logs -f […]

Categories
docker Kubernetes

Kubernetes: Kompose

Kompose is a conversion tool for Docker Compose to container orchestrators such as Kubernetes (or OpenShift). In this example, I’ll be using a Mac along with Minikube. I’ll be exposing a NodePort in order to view the services within a browser. http://kompose.io/ https://github.com/kubernetes/kompose/releases Install macOS: Homebrew brew install kompose Create docker-comose.yaml vi docker-compose.yamlversion: ‘3’services: httpd: […]

Categories
docker

docker-compose redis-cluster

Clone git repository Updated: June 25, 2020 Clone the repo. https://github.com/itsmetommy/docker-redis-cluster cd into repo. cd docker-redis-cluster Build and start all containers docker-compose up –build -d Example docker-compose up –build -d Creating network “docker-redis-cluster_redisnet” with driver “bridge” Building redis-1 Step 1/7 : FROM redis:latest —> 63130206b0fa Step 2/7 : MAINTAINER Tommy Elmesewdy r1tommy@gmail.com —> Using cache […]