docker tips Docker tips images Remove all dangling images 1docker image prune Prompt 1PS1='🐳 \[\033[1;36m\]\h \[\033[1;34m\]\W\[\033[0;35m\] \[\033[1;36m\]# \[\033[0m\]' Mount tmpfs 1 2 3 4docker run -it --rm \ --mount type=tmpfs,destination=/mnt/ramdisk,tmpfs-size=64m,tmpfs-mode=1777 \ ubuntu:22.04 \ /bin/bash check mount1 2 3df -h /mnt/ramdisk Filesystem Size Used Avail Use% Mounted on tmpfs 64M 0 64M 0% /mnt/ramdisk using compose 1 2 3 4 5 6 7 8services: app: image: ubuntu:22.04 command: bash tmpfs: - /mnt/ramdisk:size=64m,mode=1777 stdin_open: true tty: true run1docker compose -f tmpfs.yaml up -d shell1docker exec -it code-app-1 /bin/bash check mount1 2 3df -h /mnt/ramdisk Filesystem Size Used Avail Use% Mounted on tmpfs 64M 0 64M 0% /mnt/ramdisk Devices Demo: share pixhawk device with docker host1 2 3 4 5 6dmesg usb 3-4.1.5.4: Product: CubeOrange usb 3-4.1.5.4: Manufacturer: Hex/ProfiCNC usb 3-4.1.5.4: SerialNumber: 1F0048001451303039333335 cdc_acm 3-4.1.5.4:1.0: ttyACM0: USB ACM device host1 2ll /dev/ttyACM0 crw-rw---- 1 root dialout 166, 0 Jul 11 07:19 /dev/ttyACM0 add to compose1 2 3 4 5 6 devices: - /dev/ttyACM0:/dev/ttyACM0 group_add: - dialout device_cgroup_rules: - 'c 166:* rmw' Demo: share by name 1 2 3ll /dev/serial/by-id/ # lrwxrwxrwx 1 root root 13 Jul 12 12:12 usb-ArduPilot_fmuv2_430032000551353532333634-if00 -> ../../ttyACM0 compose1 2 3 4 5 6 7devices: - /dev/serial/by-id/usb-ArduPilot_fmuv2_430032000551353532333634-if00:/dev/ttyPIXHawk group_add: - dialout device_cgroup_rules: - 'c 166:* rmw' restart: