Pulling image for different platforms
docker pull --platform linux/arm64 alpine:3.16
docker pull --platform linux/arm alpine:3.16
docker pull --platform linux/arm/v6 alpine:3.16
docker pull --platform linux/arm/v7 alpine:3.16
Dockerizing binary
# This command will create docker build directory under $(pwd)/flutter-pi and copy all relevant files there
dockerize -n -o $(pwd)/flutter-pi /home/orangepi/Build/flutter-pi/build/flutter-pi
# Other files can be copied and additional dockerize calls can be created with same output dir to add additional binaries/files
- https://blog.oddbit.com/post/2015-02-05-creating-minimal-docker-images/
- https://github.com/larsks/dockerize
Pruning Docker resources
Docker by default does not remove stopped container without –rm flag. The same is true for unused images.
This starts becoming a problem after some time as disk space is slowly increased after each use and at some point Docker may use gigabytes of memory. To fix this the following command may be used:
docker system prune
# Will ask a question after:
# WARNING! This will remove:
# - all stopped containers
# - all networks not used by at least one container
# - all dangling images
# - all dangling build cache