Adding docker building scripts

This commit is contained in:
stephb9959
2021-01-25 11:25:35 -08:00
parent f03074126d
commit 2e6a49fd05
12 changed files with 169 additions and 1 deletions

48
Dockerfile-manager Normal file
View File

@@ -0,0 +1,48 @@
#Build stage 0
FROM erlang:alpine
RUN apk update && \
apk add --no-cache \
bash util-linux coreutils \
curl \
make cmake gcc g++ libstdc++ libgcc git \
zlib-dev && \
touch /usr/include/sys/vtimes.h
RUN mkdir /buildroot
WORKDIR /buildroot
RUN git clone https://github.com/telecominfraproject/wlan-cloud-loadsim
WORKDIR wlan-cloud-loadsim
RUN git pull
RUN make
RUN ./docker_config_manager.sh
RUN mkdir /app_data
RUN mkdir /app_data/mnesia
RUN mkdir /app_data/logs
#build stage 1
FROM alpine
RUN apk update && \
apk add --no-cache openssl && \
apk add --no-cache ncurses-libs && \
apk add --no-cache erlang && \
apk add --no-cache \
bash util-linux coreutils \
curl \
make cmake gcc g++ libstdc++ libgcc git \
zlib-dev && \
touch /usr/include/sys/vtimes.h
COPY --from=0 /buildroot/wlan-cloud-loadsim /owls
EXPOSE 9090
EXPOSE 4369
ENTRYPOINT /owls/docker_start.sh

45
Dockerfile-monitor Normal file
View File

@@ -0,0 +1,45 @@
#Build stage 0
FROM erlang:alpine
RUN apk update && \
apk add --no-cache \
bash util-linux coreutils \
curl \
make cmake gcc g++ libstdc++ libgcc git \
zlib-dev && \
touch /usr/include/sys/vtimes.h
RUN mkdir /buildroot
WORKDIR /buildroot
RUN git clone https://github.com/telecominfraproject/wlan-cloud-loadsim
WORKDIR wlan-cloud-loadsim
RUN git pull
RUN make
RUN ./docker_config_monitor.sh
RUN mkdir /app_data
RUN mkdir /app_data/mnesia
RUN mkdir /app_data/logs
#build stage 1
FROM alpine
RUN apk update && \
apk add --no-cache openssl && \
apk add --no-cache ncurses-libs && \
apk add --no-cache erlang && \
apk add --no-cache \
bash util-linux coreutils \
curl \
make cmake gcc g++ libstdc++ libgcc git \
zlib-dev && \
touch /usr/include/sys/vtimes.h
COPY --from=0 /buildroot/wlan-cloud-loadsim /owls
ENTRYPOINT /owls/docker_start_non_manager.sh

44
Dockerfile-node Normal file
View File

@@ -0,0 +1,44 @@
#Build stage 0
FROM erlang:alpine
RUN apk update && \
apk add --no-cache \
bash util-linux coreutils \
curl \
make cmake gcc g++ libstdc++ libgcc git \
zlib-dev && \
touch /usr/include/sys/vtimes.h
RUN mkdir /buildroot
WORKDIR /buildroot
RUN git clone https://github.com/telecominfraproject/wlan-cloud-loadsim
WORKDIR wlan-cloud-loadsim
RUN git pull
RUN make
RUN ./docker_config_node.sh
RUN mkdir /app_data
RUN mkdir /app_data/logs
#build stage 1
FROM alpine
RUN apk update && \
apk add --no-cache openssl && \
apk add --no-cache ncurses-libs && \
apk add --no-cache erlang && \
apk add --no-cache \
bash util-linux coreutils \
curl \
make cmake gcc g++ libstdc++ libgcc git \
zlib-dev && \
touch /usr/include/sys/vtimes.h
COPY --from=0 /buildroot/wlan-cloud-loadsim /owls
ENTRYPOINT /owls/docker_start_non_manager.sh

3
docker_build.sh Executable file
View File

@@ -0,0 +1,3 @@
docker build --no-cache --tag tip-owls-manager -f Dockerfile-manager
docker build --no-cache --tag tip-owls-node -f Dockerfile-node
docker build --no-cache --tag tip-owls-monitor -f Dockerfile-monitor

7
docker_config_monitor.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
# This file is used from within the docker build script to copy the proper configurations for the manager
cp priv/templates/simmonitor.config.template.docker config/sys.config
cp priv/templates/simmonitor.args.template.docker config/vm.args

7
docker_config_node.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
# This file is used from within the docker build script to copy the proper configurations for the manager
cp priv/templates/simnode.config.template.docker config/sys.config
cp priv/templates/simnode.args.template.docker config/vm.args

3
docker_run_manager.sh Executable file
View File

@@ -0,0 +1,3 @@
mkdir docker_logs
# docker run -it -p 9091:9090 --init --volume="$PWD/ssl:/etc/ssl/certs" --volume="$PWD/docker_logs:/app_data/logs" -e ERL_NODE_NAME="simmanager1@renegademac.arilia.com" tip-owls-1
docker run -d -p 9091:9090 --init --volume="$PWD/ssl:/etc/ssl/certs" --volume="$PWD/docker_logs:/app_data/logs" -e ERL_NODE_NAME="simmanager1@renegademac.arilia.com" tip-owls-manager

3
docker_run_monitor.sh Executable file
View File

@@ -0,0 +1,3 @@
mkdir docker_logs
# docker run -it -p 9091:9090 --init --volume="$PWD/ssl:/etc/ssl/certs" --volume="$PWD/docker_logs:/app_data/logs" -e ERL_NODE_NAME="simmanager1@renegademac.arilia.com" tip-owls-1
docker run -d -p 9091:9090 --init --volume="$PWD/ssl:/etc/ssl/certs" --volume="$PWD/docker_logs:/app_data/logs" -e ERL_NODE_NAME="simmanager1@renegademac.arilia.com" tip-owls-monitor

3
docker_run_node.sh Executable file
View File

@@ -0,0 +1,3 @@
mkdir docker_logs
# docker run -it -p 9091:9090 --init --volume="$PWD/ssl:/etc/ssl/certs" --volume="$PWD/docker_logs:/app_data/logs" -e ERL_NODE_NAME="simmanager1@renegademac.arilia.com" tip-owls-1
docker run -d -p 9091:9090 --init --volume="$PWD/ssl:/etc/ssl/certs" --volume="$PWD/docker_logs:/app_data/logs" -e ERL_NODE_NAME="simmanager1@renegademac.arilia.com" tip-owls-node

View File

@@ -2,4 +2,4 @@
# This file in invoked from within docker to start the application. It should not be used otherwise.
cd /owls
erl -config config/sys.config -args_file config/vm.args -name $ERL_NODE_NAME -noinput -noshell -pa deps/*/ebin -pa ebin
erl -config config/sys.config -args_file config/vm.args -name $ERL_NODE_NAME -noinput -noshell -detached -pa deps/*/ebin -pa ebin

5
docker_start_non_manager.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
# This file in invoked from within docker to start the application. It should not be used otherwise.
cd /owls
erl -config config/sys.config -args_file config/vm.args -name $ERL_NODE_NAME -noinput -noshell -detached -pa deps/*/ebin -pa ebin