leaves temp files around, inflating docker image size

What is the problem you are having with rclone? leaves temp files around, inflating docker layer size

To repro:


FROM ubuntu:22.04

RUN apt-get update && apt-get install -y \
    curl zip \
    && rm -rf /var/lib/apt/lists/*

RUN curl | bash

Build it:

docker build . -t rclone-example

Inspect layers with dive:

dive rclone-example

This shows an additional 82MB in the layer from temp files:

To fix this, we can remove the temp files towards the end of

rm -rf "$tmp_dir"

Run the command 'rclone version' and share the full output of the command.

curl | sudo bash

Which cloud storage system are you using? (eg Google Drive)


The command you were trying to run (eg rclone copy /tmp remote:tmp)


The rclone config contents with secrets removed.


A log from the command with the -vv flag


This should be easy fix.

Add $tmp_dir cleaning to the install script

and submit PR.

Created a PR: Clean up temp files in install script by jahands · Pull Request #7436 · rclone/rclone (


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.