1 Star 0 Fork 19

lanxingmo / Dragonfly

forked from Gitee 极速下载 / Dragonfly 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 5.68 KB
一键复制 编辑 原始数据 按行查看 历史

Dragonfly Quick Start

In this quick start guide, you will get a feeling of Dragonfly by starting a SuperNode (the server) in your Docker container, installing the Dragonfly client (the client), and then downloading a container image and a general file, which are likely what you'll be doing frequently in your use case.

Prerequisites

You have started your Docker container.

Step 1: Starting a SuperNode (the Server) in Your Docker Container

  1. Pull the docker image we provided.

    # Replace ${imageName} with the real image name
    docker pull ${imageName}

    Note: Choose one of the images we provide according to your geo-location, and replace ${imageName} with it:

    • China: registry.cn-hangzhou.aliyuncs.com/alidragonfly/supernode:0.2.0
    • US: registry.us-west-1.aliyuncs.com/alidragonfly/supernode:0.2.0
  2. Start a SuperNode.

    # Replace ${imageName} with the real image name
    docker run -d -p 8001:8001 -p 8002:8002 ${imageName}

For example, if you're in China, run the following commands:

docker pull registry.cn-hangzhou.aliyuncs.com/alidragonfly/supernode:0.2.0

docker run -d -p 8001:8001 -p 8002:8002 registry.cn-hangzhou.aliyuncs.com/alidragonfly/supernode:0.2.0

Step 2: Installing Dragonfly Client

You have two options of installing Dragonfly client: installing from source code, or installing by pulling the image.

Option 1: Installing from Source Code

  1. Download a package of the client.

    cd $HOME
    # Replace ${package} with a package appropriate for your operating system and location
    wget ${package}

    Note: Choose one of the packages we provide according to your geo-location, and replace ${package} with it:

    • If you're in China:

      • Linux 64-bit: http://dragonfly-os.oss-cn-beijing.aliyuncs.com/df-client_0.2.0_linux_amd64.tar.gz

      • MacOS 64-bit: http://dragonfly-os.oss-cn-beijing.aliyuncs.com/df-client_0.2.0_darwin_amd64.tar.gz

    • If you're not in China:

      • Linux 64-bit: https://github.com/dragonflyoss/Dragonfly/releases/download/v0.2.0/df-client_0.2.0_linux_amd64.tar.gz

      • MacOS 64-bit: https://github.com/dragonflyoss/Dragonfly/releases/download/v0.2.0/df-client_0.2.0_darwin_amd64.tar.gz

  2. Unzip the package.

    # Replace ${package} with a package appropriate for your operating system and location
    tar -zxf ${package}
  3. Add the directory of df-client to your PATH environment variable to make sure you can directly use dfget and dfdaemon command.

    # Execute or add this line to ~/.bashrc
    export PATH=$PATH:$HOME/df-client/

For example, if you're in China and using Linux, run the following commands:

cd $HOME
wget http://dragonfly-os.oss-cn-beijing.aliyuncs.com/df-client_0.2.0_linux_amd64.tar.gz
tar -zxf df-client_0.2.0_linux_amd64.tar.gz
# execute or add this line to ~/.bashrc
export PATH=$PATH:$HOME/df-client/

Option 2: Installing by Pulling the Image

  1. Pull the docker image we provided.

    docker pull dragonflyoss/dfclient:v0.3.0_dev
  2. Start dfdaemon.

    docker run -d -p 65001:65001 dragonflyoss/dfclient:v0.3.0_dev --registry https://xxx.xx.x
  3. Configure the Daemon Mirror.

    a. Modify the configuration file /etc/docker/daemon.json.

    vi /etc/docker/daemon.json

    Tip: For more information on /etc/docker/daemon.json, see Docker documentation.

    b. Add or update the configuration item registry-mirrors in the configuration file.

    "registry-mirrors": ["http://127.0.0.1:65001"]

    c. Restart Docker daemon.

    systemctl restart docker

Step 3: Downloading Images or Files

Now that you have started your SuperNode, and installed Dragonfly client, you can start downloading images or general files, both of which are supported by Dragonfly, but with slightly different downloading methods.

Use Case 1: Downloading a General File with Dragonfly

Once you have installed the Dragonfly client, you can use the dfget command to download a file.

dfget -u 'https://github.com/dragonflyoss/Dragonfly/blob/master/docs/images/logo.png' -o /tmp/logo.png

Tip: For more information on the dfget command, see dfget.

Use Case 2: Pulling an Image with Dragonfly

  1. Start dfdaemon with a specified registry, such as https://index.docker.io.

    nohup dfdaemon --registry https://index.docker.io > /dev/null 2>&1 &
  2. Add the following line to the dockerd configuration file /etc/docker/daemon.json.

    "registry-mirrors": ["http://127.0.0.1:65001"]
  3. Restart dockerd.

    systemctl restart docker
  4. Download an image with Dragonfly.

    docker pull nginx:latest

Related Topics

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lanxingmo/Dragonfly.git
git@gitee.com:lanxingmo/Dragonfly.git
lanxingmo
Dragonfly
Dragonfly
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891