Left sidebar

Docker (WID:20200710073759-docker)

Last modified: 15 Oct 2020

Docker is the main containerization technology

Tools

  • Portainer - a tool to manage docker installations via web interface. Supports both local and remote installations.
  • Traefik - a super reverse proxy that routes requests to linked services (be them exposed by Docker or not).
  • Watchtower - A process for automating Docker container base image updates

Doing stuff

Connecting to a host port from inside a Docker container

Suppose the case in which we have a DB server running on the host and want to connect to it from inside a docker container. An easy solution for this would be to use --network=host when launching the container, but this is not always possible (or if you\'re using Docker on Windows, at least not today: [2020-10-15 Thu]).

Note: In the future (pending the resolution of this issue) we can use host.docker.internal to access the bridge between container and host. Although this functionality seems to be working fine in MacOS and Windows.

In linux we can use the command ip a to find the IP address of the docker0 interface. We can then use this IP from within the container to reference the bridge. See this stackoverflow answer for more details.