mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Move container build files into their own dir and introduce the scope script.
This commit is contained in:
11
docker/Dockerfile
Normal file
11
docker/Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
||||
FROM gliderlabs/alpine
|
||||
MAINTAINER Weaveworks Inc <help@weave.works>
|
||||
WORKDIR /home/weave
|
||||
RUN apk add --update supervisor
|
||||
RUN ["sh", "-c", "rm -rf /var/cache/apk/*"]
|
||||
ADD supervisord.conf /etc/
|
||||
ADD ./app /home/weave/
|
||||
ADD ./probe /home/weave/
|
||||
ADD ./entrypoint.sh /home/weave/
|
||||
EXPOSE 4040
|
||||
ENTRYPOINT ["/home/weave/entrypoint.sh"]
|
||||
44
docker/entrypoint.sh
Executable file
44
docker/entrypoint.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
usage() {
|
||||
echo "$0 --dns <IP> --hostname <NAME> --searchpath <SEARCHPATH>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# This script exists to modify the network settings in the scope containers
|
||||
# as docker doesn't allow it when started with --net=host
|
||||
while true; do
|
||||
case "$1" in
|
||||
--dns)
|
||||
[ $# -gt 1 ] || usage
|
||||
DNS_SERVER="$2"
|
||||
shift 2
|
||||
;;
|
||||
--hostname)
|
||||
[ $# -gt 1 ] || usage
|
||||
HOSTNAME="$2"
|
||||
shift 2
|
||||
;;
|
||||
--searchpath)
|
||||
[ $# -gt 1 ] || usage
|
||||
SEARCHPATH="$2"
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$DNS_SERVER" -a -n "$SEARCHPATH" ]; then
|
||||
echo "domain $SEARCHPATH" >/etc/resolv.conf
|
||||
echo "search $SEARCHPATH" >>/etc/resolv.conf
|
||||
echo "nameserver $DNS_SERVER" >>/etc/resolv.conf
|
||||
fi
|
||||
|
||||
if [ -n "$HOSTNAME" ]; then
|
||||
echo "$HOSTNAME" >/etc/hostname
|
||||
hostname -F /etc/hostname
|
||||
fi
|
||||
|
||||
/usr/bin/supervisord -c /etc/supervisord.conf
|
||||
16
docker/supervisord.conf
Normal file
16
docker/supervisord.conf
Normal file
@@ -0,0 +1,16 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
|
||||
[program:app]
|
||||
command=/home/weave/app
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
[program:probe]
|
||||
command=/home/weave/probe -proc.root=/hostproc
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
Reference in New Issue
Block a user