[lxc-devel] [distrobuilder/master] sources/docker-http: Fix SIGSEGV

geaaru on Github lxc-bot at linuxcontainers.org
Tue May 21 08:02:05 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 390 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190521/6a810ade/attachment.bin>
-------------- next part --------------
From ac2ecca2215d477f88f253f34869532a5448e7b5 Mon Sep 17 00:00:00 2001
From: Daniele Rondina <geaaru at sabayonlinux.org>
Date: Mon, 20 May 2019 17:20:22 +0200
Subject: [PATCH] sources/docker-http: Fix SIGSEGV

Signed-off-by: Daniele Rondina <geaaru at sabayonlinux.org>
---
 sources/docker.go | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sources/docker.go b/sources/docker.go
index 0370e95..da120a4 100644
--- a/sources/docker.go
+++ b/sources/docker.go
@@ -1,6 +1,7 @@
 package sources
 
 import (
+	"os"
 	"path/filepath"
 
 	dcapi "github.com/mudler/docker-companion/api"
@@ -23,7 +24,9 @@ func (d *DockerHTTP) Run(definition shared.Definition, rootfsDir string) error {
 		return err
 	}
 
-	// NOTE: For now we use only docker official server but we can
-	//       add a new parameter on DefinitionSource struct.
-	return dcapi.DownloadAndUnpackImage(definition.Source.URL, absRootfsDir, nil)
+	// If DOCKER_REGISTRY_BASE is not set it's used default https://registry-1.docker.io
+	return dcapi.DownloadAndUnpackImage(definition.Source.URL, absRootfsDir, &dcapi.DownloadOpts{
+		RegistryBase: os.Getenv("DOCKER_REGISTRY_BASE"),
+		KeepLayers:   false,
+	})
 }


More information about the lxc-devel mailing list