Skip to content

Instantly share code, notes, and snippets.

@fredysan
Last active August 6, 2020 15:01
Show Gist options
  • Save fredysan/36da506ad0415a095e0136e73a674217 to your computer and use it in GitHub Desktop.
Save fredysan/36da506ad0415a095e0136e73a674217 to your computer and use it in GitHub Desktop.
Docker Cheat Sheet

Docker Cheat Sheet

List images

$ docker images

List running containers

$ docker ps

List all containers

$ docker ps -a

Get a container IP Address

$ docker inspect -f \
  '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' \
  [CONTAINER-NAME]

  or

$ docker exec [CONTAINER-NAME] cat /etc/hosts

Get access to a container

$ docker exec -it [CONTAINER-NAME] /bin/bash

Disable the DNS Server.

$ fin system stop
$ fin config set --global DOCKSAL_NO_DNS_RESOLVER=1
$ fin system start

# After that we'll have to add our docksal domains to the /etc/hosts file
$ fin hosts add drupal8.docksal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment