This repository provides three ways to test upload speed for Docker Hub.
- Using Java Google HTTP Client.
- Using Java Apache HttpClient.
- Using
curl
with Bash.
Uploading random 40MB to Docker Hub using Google HTTP Client
- Update Docker Hub account and repository information in
GoogleHttpClientMain.java
.public static void main(String[] args) throws IOException { String username = YOUR DOCKER HUB ACCOUNT String password = YOUR DOCKER HUB PASSWORD String dockerHubRepo = YOUR DOCKER HUB TEST REPO (e.g., myaccount/myrepo)
- Compile first.
$ mvn compile
- Run.
$ mvn exec:java -Dexec.mainClass=GoogleHttpClientMain
Uploading random 40MB to Docker Hub using Apache HttpClient
- Update Docker Hub account and repository information in
ApacheHttpClientMain.java
.public static void main(String[] args) throws IOException { String username = YOUR DOCKER HUB ACCOUNT String password = YOUR DOCKER HUB PASSWORD String dockerHubRepo = YOUR DOCKER HUB TEST REPO (e.g., myaccount/myrepo)
- Compile first.
$ mvn compile
- Run.
$ mvn exec:java -Dexec.mainClass=ApacheHttpClientMain
Uploading using curl
with Bash
-
Run the
push_blob_test.sh
script and follow the prompts.Example output:
Enter path to a large file to upload. Note you can easily generate a 40mb file with the following command: $ dd bs=1M count=40 < /dev/urandom > 40mb.file Path? ./40mb.file Your Docker Hub account? francium25 Your Docker Hub password? Your Docker Hub target repo (e.g., myaccount/myrepo)? francium25/test Verbose curl logging (y/[N])? % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4297 0 4297 0 0 28456 0 --:--:-- --:--:-- --:--:-- 28456 >>> Got token (don't reveal this in public): eyJhbG... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 >>> Got push location: https://registry-1.docker.io/v2/francium25/test/blobs/uploads/... Now pushing a BLOb: ./40mb.file real 0m1.885s user 0m0.068s sys 0m0.077s