use own docker image

This commit is contained in:
cupcakearmy 2021-11-21 21:10:32 +01:00
parent 3029259d82
commit 0c71bea93e
No known key found for this signature in database
GPG Key ID: 3235314B4D31232F
2 changed files with 7 additions and 3 deletions

View File

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.5.1] - 2021-11-21
### Changed
- use official docker image instead of installing rclone every time docker is used.
## [1.5.0] - 2021-11-20
### Added

View File

@ -194,15 +194,13 @@ func (b Backend) ExecDocker(l Location, args []string) (string, error) {
splitted := strings.Split(strings.TrimSpace(configFile), "\n")
configFilePath := splitted[len(splitted)-1]
docker = append(docker, "--volume", configFilePath+":"+"/root/.config/rclone/rclone.conf:ro")
// Install rclone in the container
args = append([]string{"apk", "add", "rclone", "&&"}, args...)
default:
return "", fmt.Errorf("Backend type \"%s\" is not supported as volume endpoint", b.Type)
}
for key, value := range env {
docker = append(docker, "--env", key+"="+value)
}
docker = append(docker, "restic/restic", "-c", strings.Join(args, " "))
docker = append(docker, "cupcakearmy/autorestic", "-c", strings.Join(args, " "))
out, err := ExecuteCommand(options, docker...)
return out, err
}