serhii.net

In the middle of the desert you can say anything you want

27 Apr 2021

Day 847

Docker stuff

  • Making it run as non-root: Post-installation steps for Linux | Docker Documentation
    • newgrp docker has to be run from each cli you’ll be using docker from?.. Until you restart
  • Best tutorial ever can be started with: docker run -d -p 80:80 docker/getting-started
    • It will start as docker image
    • Very readable and step-by-step
  • Docker compose
  • Random docker stop accepts the full name (distracted_perlman), but part of its container_id works!
  • Unintuitively, the COPY instruction from a Dockerfile copies the contents of the directory, but not the directory itself! 1

Clean up journalctl

Logs take space (4gb on my box!). To see how much specifically journalctl does:2

journalctl --disk-usage
sudo journalctl --vacuum-time=3d

Jupyter notebooks has terminals!

New -> Terminal. (Which you can use to access your docker running jupyter-notebook)

Docker build contexts and relative paths

$ docker build -t dt2test -f ./docker/Dockerfile . - passes the Dockerfile as explicit parameter, inside it paths are relative to the folder you run docker build in.

For docker compose:

#docker-compose.yml
version: '3.3'    
services:
      yourservice:
        build:
          context: ./
          dockerfile: ./docker/yourservice/Dockerfile

A lot of other nice options at Docker: adding a file from a parent directory - Stack Overflow

Nel mezzo del deserto posso dire tutto quello che voglio.