Skip to content
Snippets Groups Projects
Commit cd68cae1 authored by David Schmitz's avatar David Schmitz
Browse files

feature/exabgp_with_docker-compose2: try to exploit docker build cache by...

feature/exabgp_with_docker-compose2: try to exploit docker build cache by splitting install-debian:sh run in 3 phases; use decouple venv dir from main FOD dir (avoid mixing python bin/lib stuff within container with python bin/libs outside) - delta
parent 42d0dbd8
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,8 @@ EXPOSE 8000
COPY install-debian.sh /opt/FOD
RUN ./install-debian.sh --basesw_os --here__with_venv_relative --supervisord
RUN apt-get install -y pkg-config
# 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
......
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
COPY docker-compose/fod_setup_environment-1step.sh /opt/setup_environment.sh
RUN mkdir -p /var/run/supervisor
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 pkg-config
RUN useradd exabgp
WORKDIR /opt/FOD
EXPOSE 8000
CMD /opt/setup_environment.sh && supervisord -c docker-compose/fod_supervisord.conf
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
RUN apt-get install -y pkg-config
# 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 will be done in first CMD / run
#COPY docker-compose/fod_setup_environment.sh /opt/setup_environment.sh # includes tryinfo to redo step 1 + step 2 again (at least ensure everything is really up-to-date)
#COPY docker-compose/fod_setup_environment.sh /opt/setup_environment.sh # only to the least minimal adaptions necessary in the bind-mounted FOD dir are performed
COPY docker-compose/fod_setup_environment-step3.sh /opt/setup_environment.sh
CMD /opt/setup_environment.sh && supervisord -c docker-compose/fod_supervisord.conf
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment