there's nothing particular in the logs. Dockerfiles are very long, but the rclone executable was just copied inside.
Anyway I did another test using network=host, i.e using the host network stack, and that is a fast as on the host.
So the slowness happens in the docker network bridge. Just wondering what kind of network calls would slow down rclone more than aws cli.
Anyway here's the log:
2022/05/24 12:12:41 DEBUG : Setting --vfs-cache-mode "writes" from environment variable RCLONE_VFS_CACHE_MODE="writes"
2022/05/24 12:12:41 DEBUG : Setting --vfs-cache-mode "writes" from environment variable RCLONE_VFS_CACHE_MODE="writes"
2022/05/24 12:12:41 DEBUG : Setting --vfs-cache-mode "writes" from environment variable RCLONE_VFS_CACHE_MODE="writes"
2022/05/24 12:12:41 DEBUG : Setting --vfs-cache-mode "writes" from environment variable RCLONE_VFS_CACHE_MODE="writes"
2022/05/24 12:12:41 DEBUG : Setting --vfs-cache-mode "writes" from environment variable RCLONE_VFS_CACHE_MODE="writes"
2022/05/24 12:12:41 DEBUG : Setting --vfs-cache-mode "writes" from environment variable RCLONE_VFS_CACHE_MODE="writes"
2022/05/24 12:12:41 DEBUG : Setting --vfs-cache-mode "writes" from environment variable RCLONE_VFS_CACHE_MODE="writes"
2022/05/24 12:12:41 DEBUG : Setting --vfs-cache-mode "writes" from environment variable RCLONE_VFS_CACHE_MODE="writes"
2022/05/24 12:12:41 NOTICE: --dump-headers is obsolete - please use --dump headers instead
2022/05/24 12:12:41 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "-vvv" "--dump-headers" "lsd" ":s3,env_auth:"]
2022/05/24 12:12:41 DEBUG : Creating backend with remote ":s3,env_auth:"
2022/05/24 12:12:41 DEBUG : :s3: detected overridden config - adding "{YTu53}" suffix to name
2022/05/24 12:12:41 NOTICE: Config file "/home/docker/.config/rclone/rclone.conf" not found - using defaults
2022/05/24 12:12:41 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2022/05/24 12:12:41 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2022/05/24 12:12:41 DEBUG : fs cache: renaming cache item ":s3,env_auth:" to be canonical ":s3{YTu53}:"
2022/05/24 12:12:41 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2022/05/24 12:12:41 DEBUG : HTTP REQUEST (req 0xc0006a5a00)
2022/05/24 12:12:41 DEBUG : PUT /latest/api/token HTTP/1.1
Host: 169.254.169.254
User-Agent: rclone/v1.57.0
Content-Length: 0
X-Aws-Ec2-Metadata-Token-Ttl-Seconds: 21600
Accept-Encoding: gzip
2022/05/24 12:12:41 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I have the same behaviour using the official rclone docker image:
$ docker run --rm -ti rclone/rclone -vvv --dump-headers lsd ":s3,region=us-east-1,provider=AWS,env_auth:"
2022/05/24 12:47:24 NOTICE: --dump-headers is obsolete - please use --dump headers instead
2022/05/24 12:47:24 DEBUG : rclone: Version "v1.58.1" starting with parameters ["rclone" "-vvv" "--dump-headers" "lsd" ":s3,region=us-east-1,provider=AWS,env_auth:"]
2022/05/24 12:47:24 DEBUG : Creating backend with remote ":s3,region=us-east-1,provider=AWS,env_auth:"
2022/05/24 12:47:24 DEBUG : :s3: detected overridden config - adding "{sxY6V}" suffix to name
2022/05/24 12:47:24 NOTICE: Config file "/config/rclone/rclone.conf" not found - using defaults
2022/05/24 12:47:24 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2022/05/24 12:47:24 DEBUG : You have specified to dump information. Please be noted that the Accept-Encoding as shown may not be correct in the request and the response may not show Content-Encoding if the go standard libraries auto gzip encoding was in effect. In this case the body of the request will be gunzipped before showing it.
2022/05/24 12:47:24 DEBUG : fs cache: renaming cache item ":s3,region=us-east-1,provider=AWS,env_auth:" to be canonical ":s3{sxY6V}:"
2022/05/24 12:47:24 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2022/05/24 12:47:24 DEBUG : HTTP REQUEST (req 0xc000862d00)
2022/05/24 12:47:24 DEBUG : PUT /latest/api/token HTTP/1.1
Host: 169.254.169.254
User-Agent: rclone/v1.58.1
Content-Length: 0
X-Aws-Ec2-Metadata-Token-Ttl-Seconds: 21600
Accept-Encoding: gzip
2022/05/24 12:47:24 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
switching to network host mode make it instantaneous
last piece of information: on my local computer, using the official rclone docker image, it is fast both on bridge and host mode. So there's something related to my ec2 instances...