#build with sudo buildah bud -t gateway:latest .

# Get the base Ubuntu image from Docker Hub
FROM debian:stable

RUN chown -R _apt /var/lib/apt
# Update apps on the base image
RUN apt-get update
RUN apt-get upgrade

# Install the Clang compiler
# RUN apt-get -y install


####### DEBUG packete

RUN apt-get -y install tcpdump nano netcat-openbsd htop


########


# install all used libs
RUN apt-get -y install libsodium23 libuuid1 libstdc++5 libcurl4 libcurl4-gnutls-dev

# copy all custom buld libs
     
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/libzmq/lib/libzmq.so.5  /usr/lib/
# COPY build/libs/EntityLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/libprotobuf.so.32 /usr/lib/
# COPY build/libs/SimCore/libs/whisper-com/libs/protobuf/libprotobuf.so.32 /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/libprotobuf*.so.25.0.0 /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/crc/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/base/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/log/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/debugging/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/flags/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/container/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/hash/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/numeric/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/profiling/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/status/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/strings/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/synchronization/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/time/*.so.* /usr/lib/
COPY build/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/third_party/abseil-cpp/absl/types/*.so.* /usr/lib/


COPY build/libs/OrderLibrary/libs/SimCore/libs/geographiclib/src/libGeographicLib.so.23 /usr/lib/
# COPY build/libs/KubeControl/libs/yaml-cpp/libyaml-cpp.so.0.8 /usr/lib/
COPY build/libs/KubeControl/libs/curlpp/libcurlpp.so.1  /usr/lib/
# COPY build/libs/EntityLibrary/libs/SimCore/libs/crossguid/libcrossguid.so.0 /usr/lib/
# COPY build/libs/SimCore/libs/crossguid/libcrossguid.so.0  /usr/lib/
# COPY build/libs/SimCore/libs/crossguid/libcrossguid-dgb.so.0  /usr/lib/

COPY build/libs/ixwebsocket/libixwebsocket.so.0.1.0  /usr/lib/


# Copy the current folder which contains C++ source code to the Docker image under /usr/src
COPY build/docs/config /usr/local/bin/docs/
COPY build/SimControlApplication /usr/local/bin/

# # Specify the working directory
WORKDIR /usr/local/bin/

# # Use Clang to compile the Test.cpp source file
# RUN clang++ -o Test Test.cpp

# Run the output program from the previous step
CMD ["SimControlApplication"]

# CMD ["bin/bash"]