Categories
github

GitHub Container Registry

General https://ghcr.io https://github.blog/2020-09-01-introducing-github-container-registry/ Note: GitHub Container Registry is free for public images. Container Registry is free for private images during the beta, and as part of GitHub Packages will follow the same pricing model when generally available. Create personal token https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token Go to https://github.com/settings/tokens. Click Generate new token. Permissions: write:packages / read:packages delete:packages Click Generate token. Copy […]

Categories
General

Push to Google Cloud Registry

https://cloud.google.com/container-registry/docs/overview https://cloud.google.com/container-registry/docs/pushing-and-pulling Auth gcloud auth logingcloud auth configure-docker Pull # Option 1 – pull from Docker Hub docker pull [USERNAME]/[IMAGE]:[TAG] # Option 2 – pull from GCR docker pull [REPOSITORY_NAME]/[FOLDER]/[IMAGE]:[TAG] Example # Option 1 – pull from Docker Hub docker pull itsmetommy/go-guestbook:latest # Option 2 – pull from GCR docker pull us.gcr.io/[PROJECT_ID]/itsmetommy/go-guestbook:latest Tag Note: Use […]

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 […]