From fcda5ecaeb96f009d3248b478824b60a9f2e9ab9 Mon Sep 17 00:00:00 2001 From: Steve Traylen Date: Fri, 16 Apr 2021 10:13:18 +0200 Subject: [PATCH 1/3] Use go 1.16 for build_binaries method --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 18ac437..d94f69e 100644 --- a/Rakefile +++ b/Rakefile @@ -51,7 +51,7 @@ task :build_binaries do source = "/go/src/github.com/choria-io/aaasvc" - sh 'docker run --rm -v `pwd`:%s -e SOURCE_DIR=%s -e ARTIFACTS=%s -e SHA1="%s" -e BUILD="%s" -e VERSION="%s" -e BINARY_ONLY=1 choria/packager:el7-go13' % [ + sh 'docker run --rm -v `pwd`:%s -e SOURCE_DIR=%s -e ARTIFACTS=%s -e SHA1="%s" -e BUILD="%s" -e VERSION="%s" -e BINARY_ONLY=1 choria/packager:el7-go1.16' % [ source, source, source, From de24b3bdf77e97c9a4573964e8667dd57b0620bf Mon Sep 17 00:00:00 2001 From: Steve Traylen Date: Fri, 16 Apr 2021 10:31:53 +0200 Subject: [PATCH 2/3] Support podman user socket Can be run as ``` DOCKER_SOCKET=/run/user/$(id -u)/podman/podman.sock rake build ``` now to use a podman socket. Defaults to no change. --- Rakefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index d94f69e..986dd26 100644 --- a/Rakefile +++ b/Rakefile @@ -14,6 +14,7 @@ end desc "Builds packages" task :build do version = ENV["VERSION"] || "0.0.0" + docker_socket = ENV["DOCKER_SOCKET"] || "/var/run/docker.sock" sha = `git rev-parse --short HEAD`.chomp build = ENV["BUILD"] || "foss" packages = (ENV["PACKAGES"] || "").split(",") @@ -30,7 +31,8 @@ task :build do builder = "choria/packager:el7-go1.16" end - sh 'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v `pwd`:%s -e SOURCE_DIR=%s -e ARTIFACTS=%s -e SHA1="%s" -e BUILD="%s" -e VERSION="%s" -e PACKAGE=%s %s' % [ + sh 'docker run --rm -v %s:/var/run/docker.sock -v `pwd`:%s -e SOURCE_DIR=%s -e ARTIFACTS=%s -e SHA1="%s" -e BUILD="%s" -e VERSION="%s" -e PACKAGE=%s %s' % [ + docker_socket, source, source, source, From 991347ba11fba28559d62a1825dcf1ec7881d288 Mon Sep 17 00:00:00 2001 From: Steve Traylen Date: Fri, 16 Apr 2021 10:35:37 +0200 Subject: [PATCH 3/3] Allow bind mounted source to be visible when selinux present Adding the :Z onto bind mount of the source so it can be viewed. (:Z = private and unshared) --- Rakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 986dd26..ffde096 100644 --- a/Rakefile +++ b/Rakefile @@ -31,7 +31,7 @@ task :build do builder = "choria/packager:el7-go1.16" end - sh 'docker run --rm -v %s:/var/run/docker.sock -v `pwd`:%s -e SOURCE_DIR=%s -e ARTIFACTS=%s -e SHA1="%s" -e BUILD="%s" -e VERSION="%s" -e PACKAGE=%s %s' % [ + sh 'docker run --rm -v %s:/var/run/docker.sock -v `pwd`:%s:Z -e SOURCE_DIR=%s -e ARTIFACTS=%s -e SHA1="%s" -e BUILD="%s" -e VERSION="%s" -e PACKAGE=%s %s' % [ docker_socket, source, source, @@ -53,7 +53,7 @@ task :build_binaries do source = "/go/src/github.com/choria-io/aaasvc" - sh 'docker run --rm -v `pwd`:%s -e SOURCE_DIR=%s -e ARTIFACTS=%s -e SHA1="%s" -e BUILD="%s" -e VERSION="%s" -e BINARY_ONLY=1 choria/packager:el7-go1.16' % [ + sh 'docker run --rm -v `pwd`:%s:Z -e SOURCE_DIR=%s -e ARTIFACTS=%s -e SHA1="%s" -e BUILD="%s" -e VERSION="%s" -e BINARY_ONLY=1 choria/packager:el7-go1.16' % [ source, source, source,