Skip to content

Instantly share code, notes, and snippets.

@yesidays
Last active August 13, 2019 04:11
Show Gist options
  • Save yesidays/f5cc8ead0daab541fa4133e172730dba to your computer and use it in GitHub Desktop.
Save yesidays/f5cc8ead0daab541fa4133e172730dba to your computer and use it in GitHub Desktop.

Docker commands

ID of the container

docker ps

Inspect containers

docker inspect [container-id]

Docker Images

docker images

Removing All Unused Objects

docker system prune

Postgres

Pull image docker pull postgres:alpine

Run postgres

docker run --name postgres-local -e POSTGRES_PASSWORD=123456 -d -p 5432:5432 postgres:alpine

Interact with Postgres

docker exec -it postgres-local bash

psql -U postgres

\du

create database name_database;

\l

\c name_database;

\dt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment