Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

RancherOS 1.5 zfs service issue #2633

Closed
jdoucerain opened this issue Jan 7, 2019 · 4 comments
Closed

RancherOS 1.5 zfs service issue #2633

jdoucerain opened this issue Jan 7, 2019 · 4 comments

Comments

@jdoucerain
Copy link

RancherOS Version: (ros os version)
1.5
Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)
VM on premises

Hi there,
I am encountering an issue when I try to use RancherOS behind a proxy.
Everything is running fine (installation, upgrade, configuration,...) but when I am trying to set the zfs service up, the build.sh is failing.

The build.sh is leveraging the populated HTTP_PROXY, HTTPS_PROXY, NO_PROXY environment variables, but at the end of the script, the system-docker command used to build the zfs-tools image is not propagating the environment variables.

I simply tried to add --build-arg options on the system-docker build command and it worked nice.
See my patch below on the github rancher/os-services project

diff --git a/images/20-zfs/build.sh b/images/20-zfs/build.sh
index de88a32..5fd8463 100755
--- a/images/20-zfs/build.sh
+++ b/images/20-zfs/build.sh
@@ -121,12 +121,28 @@ done
 for i in $(ls arch/sbin); do
    echo "system-docker cp wonka.sh \${1}:/sbin/$i" >> /dist/arch/setup_wonka.sh
 done
-system-docker build --network=host -t zfs-tools arch/
+
+if [ "XX$HTTP_PROXY" != "XX" ]
+then
+       BUILD_ARGS="--build-arg HTTP_PROXY --build-arg http_proxy="$HTTP_PROXY
+fi
+
+if [ "XX$HTTPS_PROXY" != "XX" ]
+then
+       BUILD_ARGS=$BUILD_ARGS" --build-arg HTTPS_PROXY --build-arg https_proxy="$HTTPS_PROXY
+fi
+
+if [ "XX$NO_PROXY" != "XX" ]
+then
+       BUILD_ARGS=$BUILD_ARGS" --build-arg NO_PROXY --build-arg no_proxy="$NO_PROXY
+fi
+
+system-docker build --network=host $BUILD_ARGS -t zfs-tools arch/
 
 modprobe zfs
 
 /dist/arch/setup_wonka.sh console
 /dist/arch/setup_wonka.sh zfs
 zpool import -a
 
 touch $STAMP
@deniseschannon
Copy link

@jdoucerain can you make a PR into os-services?

@jdoucerain
Copy link
Author

yes sure no problem. I will do that tomorrow.

@jdoucerain
Copy link
Author

The pull request is at rancher/os-services#180
Thanks
Jerome

@niusmallnan
Copy link
Contributor

PR has been merged and backported to 1.5.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants