Install.sh leaves temp files around, inflating docker image size

What is the problem you are having with rclone?

https://rclone.org/install.sh leaves temp files around, inflating docker layer size

To repro:

Dockerfile:

FROM ubuntu:22.04

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

RUN curl https://rclone.org/install.sh | 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 install.sh:

rm -rf "$tmp_dir"

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

curl https://rclone.org/install.sh | sudo bash

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

n/a

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

n/a

The rclone config contents with secrets removed.

n/a

A log from the command with the -vv flag

n/a

This should be easy fix.

Add $tmp_dir cleaning to the install script

and submit PR.

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

2 Likes

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