-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·34 lines (30 loc) · 871 Bytes
/
build.sh
File metadata and controls
executable file
·34 lines (30 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -ex
get_apt_proxy_line() {
# Are we on Linux?
if [ ! -f /proc/net/tcp ]; then
# No - we can't use this functionality in this case
echo ''
return
fi
# Is port 3142 open on localhost?
if grep -q ':0C46 ' /proc/net/tcp; then
# Yes - then assume the docker host is an apt proxy
echo 'Acquire::http::Proxy "http://172.17.0.1:3142";'
else
# No - assume we have no apt proxy
echo ''
fi
}
if [ ! -e enhydris/enhydris_project/settings/local.py ]; then
cp local.py enhydris/enhydris_project/settings/
fi
if [ ! -e enhydris/enhydris_project/settings/urls.py ]; then
cp urls.py enhydris/enhydris_project/settings/
fi
docker build \
-t enhydris-dev \
--build-arg apt_proxy_line="`get_apt_proxy_line`" \
--build-arg USER_ID=`id -u` \
--build-arg GROUP_ID=`id -g` \
.