[lxc-devel] [distrobuilder/master] sources/docker: Permit to use private docker registry with credentials

geaaru on Github lxc-bot at linuxcontainers.org
Wed Dec 9 18:54:21 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 490 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201209/9377e22d/attachment-0001.bin>
-------------- next part --------------
From 128bdfbbb7f5cf557dec76ed35e25ff4f86c2829 Mon Sep 17 00:00:00 2001
From: Daniele Rondina <geaaru at sabayonlinux.org>
Date: Wed, 9 Dec 2020 19:51:02 +0100
Subject: [PATCH] sources/docker: Permit to use private docker registry with
 credentials

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

diff --git a/sources/docker.go b/sources/docker.go
index da120a4..860cb59 100644
--- a/sources/docker.go
+++ b/sources/docker.go
@@ -26,7 +26,9 @@ func (d *DockerHTTP) Run(definition shared.Definition, rootfsDir string) error {
 
 	// 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,
+		RegistryBase:     os.Getenv("DOCKER_REGISTRY_BASE"),
+		RegistryUsername: os.Getenv("DOCKER_REGISTRY_BASE_USER"),
+		RegistryPassword: os.Getenv("DOCKER_REGISTRY_BASE_PASS"),
+		KeepLayers:       false,
 	})
 }


More information about the lxc-devel mailing list