# docker ### Build arm64 image on amd64 host ```javascript docker buildx build --platform linux/arm64 -t glitchcrab/ubuntu-debug:latest --output=type=registry . ``` --- ### Run commands in container’s network namespace * get the container's ID from `docker ps`, then use it to get the PID: `pid=$(docker inspect -f '{{.State.Pid}}' ${container_id})` * ensure the netns dir exists and then create the required symlink: ``` mkdir -p /var/run/netns/ ln -sfT /proc//ns/net /var/run/netns/ ``` * run a command inside the netns: `ip netns exec ip a` --- ### Find largest container log files ```javascript find /var/lib/docker/containers \ -name '*-json.log' \ -printf '%s %p\n' \ | sort -nr \ | numfmt --to=iec ``` *** ### Check disk usage ```javascript docker system df ``` ***