blob: 6d38763aa89cf053e719d89a6859da09205ef1dc [file] [log] [blame]
Sergio Slobodrian4d307102017-04-24 10:19:00 -04001#!/bin/bash
2
David K. Bainbridge737b74f2018-01-22 12:57:52 -08003TAG=${TAG:-latest}
4
Sergio Slobodrian6f5fc4c2017-11-17 15:31:12 -05005docker run -d --name pbuild -p 9999:9000 portainer/portainer:1.15.2
Sergio Slobodrian4d307102017-04-24 10:19:00 -04006rm -fr tmp_portainer
7mkdir tmp_portainer
8docker cp pbuild:/ tmp_portainer
9
10sed -i -e '
11s~constant("DOCKER_ENDPOINT","api/docker")~constant("DOCKER_ENDPOINT","docker/api/docker")~
12s~constant("CONFIG_ENDPOINT","api/settings")~constant("CONFIG_ENDPOINT","docker/api/settings")~
13s~constant("AUTH_ENDPOINT","api/auth")~constant("AUTH_ENDPOINT","docker/api/auth")~
14s~constant("USERS_ENDPOINT","api/users")~constant("USERS_ENDPOINT","docker/api/users")~
15s~constant("ENDPOINTS_ENDPOINT","api/endpoints")~constant("ENDPOINTS_ENDPOINT","docker/api/endpoints")~
16s~constant("TEMPLATES_ENDPOINT","api/templates")~constant("TEMPLATES_ENDPOINT","docker/api/templates")~
17' tmp_portainer/js/app.*.js
Sergio Slobodrian7d7bb962017-05-04 09:54:39 -040018sed -i -e '
19s~href="~href="docker/~
20s~href='\''~href='\''docker/~
21s~src="~src="docker/~
22s~src='\''~src='\''docker/~
23s~"images/logo.png"~"docker/images/logo.png"~
24' tmp_portainer/index.html
Sergio Slobodrian4d307102017-04-24 10:19:00 -040025
David K. Bainbridge737b74f2018-01-22 12:57:52 -080026docker build -t ${REGISTRY}${REPOSITORY}voltha-portainer:${TAG} -f docker/Dockerfile.portainer .
Sergio Slobodrian4d307102017-04-24 10:19:00 -040027rm -fr tmp_portainer
28docker stop pbuild
Sergio Slobodrian7d7bb962017-05-04 09:54:39 -040029docker rm -f pbuild
Sergio Slobodrian4d307102017-04-24 10:19:00 -040030