Make building packages in docker portable
The issue was described in !267 (comment 195252). It appears that building packges in docker on a host with macOS doesn't work. It may also fail on some other platforms but I didn't check. The issue is that the packages are built in Docker by a non-root user and that the user can't access the home directory, because it is owned by root. The home directory is the GOPATH and GOCACHE directory where the user must have writing permissions. I think this issue may not occur on Ubuntu because the tools built on the host are used instead and certain packages don't need to be rebuilt.
I propose the following fix:
diff --git a/Rakefile b/Rakefile
index cac6579..5a0d93a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -810,7 +810,7 @@ def run_bld_pkg_in_dkr(dkr_image, pkg_type, side)
cmd += " && tar -C /tmp/build -zxvf /home/$USER/stork-#{TIMESTAMP}.tar.gz"
cmd += " && cp /home/$USER/isc-stork-agent* /tmp/build"
cmd += " ; cd /tmp/build"
- cmd += " && rake build_pkg pkg=#{pkg_type}_#{side} STORK_BUILD_TIMESTAMP=#{TIMESTAMP}"
+ cmd += " && rake build_pkg pkg=#{pkg_type}_#{side} STORK_BUILD_TIMESTAMP=#{TIMESTAMP} GOPATH=/tmp/build/go GOCACHE=/tmp/build/.cache/"
cmd += " && mv isc-stork* /home/$USER"
cmd += " && ls -al /home/$USER/"
cmd += "\""