reactor.dockerfile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. FROM ubuntu:22.04
  2. MAINTAINER [email protected]
  3. RUN apt-get update -yqq
  4. RUN apt-get install -yqq g++-11 gcc-11 make git
  5. RUN update-alternatives --quiet --remove-all gcc \
  6. ; update-alternatives --quiet --remove-all g++ \
  7. ; update-alternatives --quiet --remove-all cc \
  8. ; update-alternatives --quiet --remove-all cpp \
  9. ; update-alternatives --quiet --install /usr/bin/gcc gcc /usr/bin/gcc-11 20 \
  10. ; update-alternatives --quiet --install /usr/bin/cc cc /usr/bin/gcc-11 20 \
  11. ; update-alternatives --quiet --install /usr/bin/g++ g++ /usr/bin/g++-11 20 \
  12. ; update-alternatives --quiet --install /usr/bin/cpp cpp /usr/bin/g++-11 20 \
  13. ; update-alternatives --quiet --config gcc \
  14. ; update-alternatives --quiet --config cc \
  15. ; update-alternatives --quiet --config g++ \
  16. ; update-alternatives --quiet --config cpp
  17. WORKDIR /reactor-bench
  18. RUN git clone https://github.com/shaovie/reactor.git
  19. RUN cd reactor/ && make clean all
  20. COPY ./techempower.cpp /reactor-bench/reactor
  21. WORKDIR /reactor-bench/reactor
  22. RUN g++ techempower.cpp -O2 -std=c++11 -lreactor -L./bin -lpthread -o app
  23. ENV LD_LIBRARY_PATH=./bin:$LD_LIBRARY_PATH
  24. EXPOSE 8080
  25. RUN ulimit -n 100000
  26. CMD ./app