Skip to content

Instantly share code, notes, and snippets.

View grammy-jiang's full-sized avatar
:octocat:
Do one thing, do it well

Grammy Jiang grammy-jiang

:octocat:
Do one thing, do it well
View GitHub Profile
@grammy-jiang
grammy-jiang / docker for mssql.md
Last active June 13, 2019 01:58
Docker for MSSql
  1. start MSSql with docker-compose
version: "3"
services:
  mssql:
    container_name: dc-mssql
    environment:
      ACCEPT_EULA: Y
      SA_PASSWORD: P@ssw0rd
@grammy-jiang
grammy-jiang / mongo_dump_and_restore.md
Last active October 7, 2022 13:37
MongoDB dump and restore within Docker

MongoDB dump and restore within Docker

MongoDB dump

prompt the user for password

foo@bar:~$ docker run --interactive --tty --rm --network=<network> --volume=<volume>:/tmp \
  mongo:latest \
  mongodump \
@grammy-jiang
grammy-jiang / update_all_docker_images_and_remove_none_label_images.md
Last active September 8, 2024 18:38
Update all docker images & Remove the images with the label '<None>'

Update all docker images and remove dangling ones

Update all images with the 'latest' label

docker images --format "{{.Repository}}:{{.Tag}}" | grep ':latest' | xargs -L1 docker pull

Remove the dangling images

docker rmi $(docker images --quiet --filter "dangling=true")
@grammy-jiang
grammy-jiang / postgresql_dump_and_restore.md
Last active September 17, 2022 01:21
PostgreSQL dump and restore within Docker

PostgreSQL dump and restore within Docker

Dump a database in PostgreSQL with pg_dump inside a docker container

docker run \
  -it --rm -v <volume>:/tmp/pg_dump postgres:latest \
  pg_dump \
  --host=<host> --port=<port> \
  --username=<username> --password \
 --dbname= -f /tmp/pg_dump/.sql