Fixed a problem with docker mounts always being read-write and not mounting properly into containers

This commit is contained in:
Frikky
2025-04-03 19:19:40 +02:00
parent d1d06df2b0
commit b204296e71
5 changed files with 69 additions and 25 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ go 1.23.0
toolchain go1.23.6
//replace github.com/shuffle/shuffle-shared => ../../../../shuffle-shared
replace github.com/shuffle/shuffle-shared => ../../../../shuffle-shared
require (
github.com/docker/docker v27.5.0+incompatible
+12 -3
View File
@@ -744,6 +744,8 @@ func handleBackendImageDownload(ctx context.Context, images string) error {
handled := []string{}
//log.Printf("[DEBUG] Removing existing image (s): %s", images)
newImages := []string{}
successful := []string{}
for _, curimage := range strings.Split(images, ",") {
curimage = strings.TrimSpace(curimage)
if shuffle.ArrayContains(handled, curimage) {
@@ -775,12 +777,19 @@ func handleBackendImageDownload(ctx context.Context, images string) error {
err := shuffle.DownloadDockerImageBackend(&http.Client{Timeout: imagedownloadTimeout}, curimage)
if err != nil {
log.Printf("[ERROR] Failed downloading image: %s", err)
//log.Printf("[ERROR] Failed downloading image: %s", err)
} else {
log.Printf("[DEBUG] Downloaded image: %s", curimage)
//log.Printf("[DEBUG] Downloaded image: %s", curimage)
successful = append(successful, curimage)
}
}
if len(successful) == 0 {
log.Printf("[ERROR] Failed downloading image copies: %s. This means the app may not have been updated.", strings.Join(handled, ", "))
} else {
log.Printf("[DEBUG] Successfully downloaded image copies: %s", strings.Join(successful, ", "))
}
if swarmConfig == "run" || swarmConfig == "swarm" {
log.Printf("[DEBUG] Should update service with new image after updating(s): %s. \n\nBETA REPLACEMENT IMPLEMENTATION: Contact support@shuffler.io for support.", strings.Join(newImages, "\n"))
@@ -1919,7 +1928,7 @@ func main() {
}
// Handle Cleanup - made it cleanup by default
if strings.ToLower(os.Getenv("SHUFFLE_CONTAINER_AUTO_CLEANUP")) != "false" {
if strings.ToLower(os.Getenv("SHUFFLE_CONTAINER_AUTO_CLEANUP")) != "false" && os.Getenv("CLEANUP") == "" {
cleanupEnv = "true"
}