Table of contents
  1. Restart Docker
  2. Keep your Docker images small
  3. Use host ip




Restart Docker

sudo su
systemctl start docker
systemctl enable docker
systemctl restart docker

or

sudo dockerd

or

 snap stop docker
 snap start docker

or

sudo systemctl unmask docker
sudo systemctl start docker

Keep your Docker images small

Don’t install unnecessary editors. You can edit the files over SSH from the Docker host to the container.

vim scp://remoteuser@containerip//path/to/document

Use host ip

host.docker.internal
The gateway is also reachable as
gateway.docker.internal

If you are running this stack on Linux, you need to have the DOCKER_GATEWAY_HOST environment variable set for the Docker gateway host.
Put this line into
your .bashrc (.bash_profile or .zshrc)

 export DOCKER_GATEWAY_HOST=172.17.0.1
 source https://docs.docker.com/desktop/mac/networking/.
 extra hosts https://docs.docker.com/compose/compose-file/#extra_hosts