Altered the build process for the portainer container to make it more
compatible with older docker releases. Old releases would complain that
the options -d and --rm were incompatible. Also altered the way the
proxy behaves to minimize upstream re-writes, this was moved to the
container build process.
Change-Id: I5c897ed02e556201d7e3ba0d30616ed31938bac6
diff --git a/nginx_config/includes/portainer.conf b/nginx_config/includes/portainer.conf
index de64ad4..e20adc6 100644
--- a/nginx_config/includes/portainer.conf
+++ b/nginx_config/includes/portainer.conf
@@ -3,16 +3,6 @@
proxy_http_version 1.1;
proxy_set_header Connection "";
rewrite /docker/(.*) /$1 break;
- #sub_filter "/ui" "/consul/ui";
- #sub_filter "/v1" "/consul/v1";
- #sub_filter "//" "/";
- sub_filter "href='" "href='docker/";
- sub_filter 'href="' 'href="docker/';
- sub_filter "src='" "src='docker/";
- sub_filter 'src="' 'src="docker/';
- sub_filter "images/logo.png" "docker/images/logo.png";
- #sub_filter "/api/v1" "/swagger/api/v1";
- sub_filter_once off;
proxy_next_upstream error timeout invalid_header http_500;
}
diff --git a/portainer/buildPortainer.sh b/portainer/buildPortainer.sh
index 36a2707..dc0b002 100755
--- a/portainer/buildPortainer.sh
+++ b/portainer/buildPortainer.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-docker run --rm -d --name pbuild -p 9999:9000 portainer/portainer
+docker run -d --name pbuild -p 9999:9000 portainer/portainer
rm -fr tmp_portainer
mkdir tmp_portainer
docker cp pbuild:/ tmp_portainer
@@ -13,9 +13,16 @@
s~constant("ENDPOINTS_ENDPOINT","api/endpoints")~constant("ENDPOINTS_ENDPOINT","docker/api/endpoints")~
s~constant("TEMPLATES_ENDPOINT","api/templates")~constant("TEMPLATES_ENDPOINT","docker/api/templates")~
' tmp_portainer/js/app.*.js
-
+sed -i -e '
+s~href="~href="docker/~
+s~href='\''~href='\''docker/~
+s~src="~src="docker/~
+s~src='\''~src='\''docker/~
+s~"images/logo.png"~"docker/images/logo.png"~
+' tmp_portainer/index.html
docker build -t voltha/portainer -f docker/Dockerfile.portainer .
rm -fr tmp_portainer
docker stop pbuild
+docker rm -f pbuild