In order to facilitate you to quickly set up the Dragonfly environment, this article uses Docker-Compose Take kubernetes as an example to explain, if you need kubernetes related content, you can refer to Quick Start: Helm Charts
If you want to use Dragonfly to complete production-level image and file distribution in the production environment, please refer to the detailed production-level configuration parameters of supernode and dfget. If it is kubernetes, you can use https://github.com/dragonflyoss/helm-charts.
All the steps in this document are done on the same machine using the docker container, so please make sure that you have installed and started the docker container engine and installed docker-compose on your machine.
Step 1: Download and run Dragonfly docker-compose
If run with the Mac OS, an error may be reported, ref sed command with -i option failing on Mac, but works on Linux
git clone https://github.com/dragonflyoss/Dragonfly2.git
export IP=<host ip>
Step 2: Modify the Docker Daemon configuration
We need to modify the Docker Daemon configuration and use Dragonfly to pull the image by mirroring.
Add or update the following configuration items in the configuration file
Restart Docker Daemon and Dragonfly
systemctl restart docker
Tips： Note that this action affects containers running on this host For more information
/etc/docker/daemon.json, please refer to the Docker documents.
Step 3: Pull the image
Through the above steps, we have completed the deployment of Dragonfly server and client, and set up Docker Daemon to pull official images through Dragonfly.
You can pull the image as usual, for example:
docker pull nginx:latest
Step 4: Verify
You can verify that the nginx image is transferred through Dragonfly by executing the following command.
docker compose exec dfdaemon grep "peer task done" /var/log/dragonfly/daemon/core.log
If the above command has something like
"ts": "2022-09-07 12:04:26.485",
"msg": "peer task done, cost: 1ms",
It means that the mirror download is completed through Dragonfly.
Step 5: Manager Console
Open via browser
The account is
root, password is
Tip: Please remember to modify the user name and password for the generation environment
For more information refer to Manager Console document
Step 6: Preheat
To get the best out of Dragonfly, you can pull the image in advance by preheat