Skip to content

Instantly share code, notes, and snippets.

@krsna1729
Last active January 13, 2019 23:42
Show Gist options
  • Save krsna1729/c4862f278e74b337177937b6e70cc4a2 to your computer and use it in GitHub Desktop.
Save krsna1729/c4862f278e74b337177937b6e70cc4a2 to your computer and use it in GitHub Desktop.
BESS Multi-stage Dockerfile
# Multi-stage Dockerfile
# Stage bess-build: builds bess with its dependencies
FROM nefelinetworks/bess_build AS bess-build
ARG BESS_COMMIT=master
RUN apt-get update && apt-get install -y wget unzip ca-certificates git
RUN wget -qO bess.zip https://github.com/NetSys/bess/archive/${BESS_COMMIT}.zip && unzip bess.zip
WORKDIR bess-${BESS_COMMIT}
RUN ./build.py bess && cp bin/bessd /bin
RUN mkdir -p /opt/bess && cp -r bessctl pybess /opt/bess
# Stage bess: creates the runtime image of BESS sidecar
FROM python:2.7-slim as bess
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libgraph-easy-perl \
iproute2 \
tcpdump && \
rm -rf /var/lib/apt/lists/* && \
pip install --no-cache-dir \
grpcio \
protobuf \
scapy
COPY --from=bess-build /opt/bess /opt/bess
COPY --from=bess-build /bin/bessd /bin
WORKDIR /opt/bess/bessctl
CMD ./bessctl
@krsna1729
Copy link
Author

krsna1729 commented Oct 8, 2018

docker build [--build-arg="BESS_COMMIT=<sha>"] [--build-arg="http_proxy=<proxy>"] -t ngic-bessd-ctl .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment