Skip to content
Sam Roberts edited this page Dec 1, 2020 · 2 revisions

Docker

https://unixism.net/2020/06/containers-the-hard-way-gocker-a-mini-docker-written-in-go/

add to docker notes: https://jdlm.info/articles/2019/09/06/lessons-building-node-app-docker.html

Ports

Docker

  • -p,--publish [HOST:]CONTAINER -- if no HOST, it gets ephemeral host port

  • -P,--publish-all -- all container's EXPOSEd to ephemeral host port

  • Dockerfile: EXPOSE PORT[/PROTO]

    • Ever used by kube?
    • Ever used by docker-compose?
    • Seemingly not :-(

The EXPOSE instruction does not actually publish the port. It functions as a type of documentation between the person who builds the image and the person who runs the container, about which ports are intended to be published.

docker-compose

  • ports: '[HOST:]CONTAINER' -- as above
  • expose: 'CONTAINER' -- exposes port to other services, but not the host

Cleanup

Remove all images: docker rmi $(docker images -a -q)

Docker image and container exploration