Skip to content

Commit

Permalink
feature/exabgp_with_docker-compose: add alternative docker-compose fi…
Browse files Browse the repository at this point in the history
…le docker-compose-novol.yml for not using bind mounted FoD dir
  • Loading branch information
dschmitz2017 committed Jul 6, 2023
1 parent 963b525 commit 81313f0
Show file tree
Hide file tree
Showing 2 changed files with 145 additions and 0 deletions.
114 changes: 114 additions & 0 deletions docker-compose-novol.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
version: "3"
services:
fod:
build:
context: .
dockerfile: docker-compose/Dockerfile_FOD-novol
container_name: fod
privileged: true
expose:
- "8000"
ports:
- "0.0.0.0:8000:8000"
env_file:
- ./docker-compose/.env_fod
#environment:
#- fod_volume_use=0
networks:
mgmt:
xfod:
ipv4_address: 10.197.36.2
#volumes:
#- ./:/opt/FOD

freertr:
build:
context: docker-compose
dockerfile: Dockerfile_FREERTR
container_name: freertr
privileged: true
expose:
- "23"
ports:
- "127.0.0.1:2323:2323"
env_file:
- ./docker-compose/.env_freertr
networks:
mgmt:
nhost1:
ipv4_address: 10.1.10.3
nhost2:
ipv4_address: 10.2.10.3
xfod:
ipv4_address: 10.197.36.3
depends_on:
- fod
volumes:
- freertr:/opt
- ./freertr/run:/rtr/run/

host1:
build:
context: docker-compose
dockerfile: Dockerfile_HOST1
container_name: host1
privileged: true
env_file:
- ./docker-compose/.env_host1
networks:
mgmt:
nhost1:
ipv4_address: 10.1.10.11
depends_on:
- fod
#volumes:
# - freertr:/opt

host2:
build:
context: docker-compose
dockerfile: Dockerfile_HOST2
container_name: host2
privileged: true
env_file:
- ./docker-compose/.env_host2
networks:
mgmt:
nhost2:
ipv4_address: 10.2.10.12
depends_on:
- fod
#volumes:
# - freertr:/opt

networks:
mgmt:
driver: bridge
ipam:
driver: default
config:
- subnet: 11.11.11.0/24

xfod:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.197.36.0/28

nhost1:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.1.10.0/24

nhost2:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.2.10.0/24

volumes:
freertr:
31 changes: 31 additions & 0 deletions docker-compose/Dockerfile_FOD-novol
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ubuntu:latest
LABEL maintainer="FOD"
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get install -y locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
RUN apt-get update -y && apt-get -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' --assume-yes -fuy dist-upgrade
RUN apt-get install -y git less man make gcc strace ltrace lsof file vim tshark tcpdump curl wget net-tools sudo psutils procps iptables iputils-ping iputils-tracepath hping3 iproute2 supervisor
RUN useradd exabgp
RUN mkdir -p /var/run/supervisor /opt/FOD
WORKDIR /opt/FOD
EXPOSE 8000

# build step1 (exploit docker build cache, only redone if ./install-debian.sh changed)
COPY install-debian.sh /opt/FOD
RUN ./install-debian.sh --basesw_os --here__with_venv_relative --supervisord

# build step2 (exploit docker build cache, only redone if ./install-debian.sh or requirements.txt changed)
COPY requirements.txt /opt/FOD
RUN ./install-debian.sh --basesw_python --here__with_venv_relative --supervisord

# build step3
COPY . /opt/FOD
RUN ./install-debian.sh --fodproper1 --here__with_venv_relative --supervisord --setup_admin_user --setup_admin_user5 admin ${ADMIN_PASS} ${ADMIN_EMAIL} ${FOD_ORG} ${FOD_ORG_NET} --exabgp ${FOD_EXABGP_LOCAL_ID} ${FOD_EXABGP_LOCAL_IP} ${FOD_EXABGP_LOCAL_AS} ${FOD_EXABGP_REMOTE_ID} ${FOD_EXABGP_REMOTE_IP} ${FOD_EXABGP_REMOTE_AS}

#

CMD supervisord -c docker-compose/fod_supervisord.conf

0 comments on commit 81313f0

Please sign in to comment.