Commit 503a34c4 by Amir Aharon

creating develop image with microservice framework inside

parent 40edd14f
......@@ -44,6 +44,7 @@ CMakeCache.txt
cmake_install.cmake
install_manifest.txt
dist
target
*.cmake
GPATH
GTAGS
......
{
"variant": {
"label": "Debug",
"keywordSettings": {
"buildType": "debug"
},
"description": "Emit debug information without performing optimizations"
},
"activeEnvironments": []
}
\ No newline at end of file
{
"files.associations": {
"array": "cpp",
"*.tcc": "cpp",
"functional": "cpp",
"istream": "cpp",
"tuple": "cpp",
"utility": "cpp",
"bitset": "cpp",
"chrono": "cpp"
}
}
\ No newline at end of file
......@@ -60,7 +60,7 @@
"label": "build develop image",
"type": "shell",
// not using -it so that it can be a preLaunchTask
"command": "docker build -t municipalitybank.com:5050/ipgallery.common.cpp/microservice/develop .",
"command": "docker build -f Dockerfile.develop -t municipalitybank.com:5050/ipgallery.common.cpp/microservice/develop .",
"problemMatcher": []
},
{
......
......@@ -27,7 +27,7 @@ set ( PROJECT_LINK_LIBS -lPocoFoundation -ljson -lhiredis -lcpprest -lcppmetri
# -lboost_random -lboost_chrono -lboost_system -lboost_thread -lssl
# -lcrypto -lRabbitmq -lrabbitmq -llog4cpp -lglog -lzmqpp -lzmq )
link_directories( ../3party/lib )
link_directories( ../internals/lib )
#link_directories( ../internals/lib )
# h files locations
include_directories(src)
......@@ -41,7 +41,7 @@ include_directories(SYSTEM ../3party/rabbitmq)
include_directories(SYSTEM ../3party/flatbuffers/include)
include_directories(SYSTEM ../3party/poco-1.7.8/Foundation/include)
include_directories(SYSTEM ../3party/evpp/build-release/include)
include_directories(SYSTEM ../internals/include/Rabbitmq)
# include_directories(SYSTEM ../internals/include/Rabbitmq)
include_directories(SYSTEM /usr/include/Poco)
include_directories(SYSTEM /usr/include/hiredis)
......@@ -127,8 +127,8 @@ install(FILES ${INSTALL_FILES} DESTINATION include/microservice/utils)
# 3party libs
INSTALL( DIRECTORY ../3party/lib DESTINATION lib/3party )
# internal libs
file (GLOB INSTALL_FILES "../internals/lib/libRabbitmq.*")
install(FILES ${INSTALL_FILES} DESTINATION lib/internals)
#file (GLOB INSTALL_FILES "../internals/lib/libRabbitmq.*")
#install(FILES ${INSTALL_FILES} DESTINATION lib/internals)
#include 3party files
INSTALL( DIRECTORY ../3party/cereal-1.2.1/include DESTINATION include/3party/cereal-1.2.1 )
......@@ -137,8 +137,9 @@ INSTALL( DIRECTORY ../3party/cppmetrics-0.1.1-Linux/include DESTINATION include/
file (GLOB INSTALL_FILES "../3party/mongoose/mongoose.*")
install(FILES ${INSTALL_FILES} DESTINATION include/3party/mongoose)
INSTALL( DIRECTORY ../3party/cpprest/Release/include DESTINATION include/3party/cpprest )
INSTALL( DIRECTORY ../3party/evpp/build-release/include DESTINATION include/3party/evpp )
INSTALL( DIRECTORY ../3party/rabbitmq DESTINATION include/3party )
INSTALL( DIRECTORY ../internals/include/Rabbitmq DESTINATION include/internals )
#INSTALL( DIRECTORY ../internals/include/Rabbitmq DESTINATION include/internals )
INSTALL( DIRECTORY /usr/include/hiredis DESTINATION include/3party )
INSTALL( DIRECTORY ../3party/flatbuffers/include DESTINATION include/3party/flatbuffers )
......
#FROM ubuntu:14.04
#FROM ubuntu-debootstrap:14.04
FROM municipalitybank.com:5050/mcx/devops/dev-cpp
FROM municipalitybank.com:5050/ipgallery.common.cpp/microservice/develop
USER root
COPY ./doc/install-dependencies.sh /usr/
RUN chmod +x /usr/install-dependencies.sh
RUN apt-get update
RUN /usr/install-dependencies.sh
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
USER develop
RUN mkdir /home/develop/dist
COPY ./target/*.tar.gz /home/develop/dist/
RUN cd /home/develop/dist && tar xzf *.tar.gz
# setting for gcc >= 4.9.2
#RUN rm /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#COPY ./tmp/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6
......@@ -20,12 +15,6 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
#RUN echo kernel.shmmax=49249672960 >> /etc/sysctl.conf
#RUN echo kernel.shmall=10485760 >> /etc/sysctl.conf
# app
# COPY ./tmp/* /usr/lib/x86_64-linux-gnu/
# COPY ./bin/test_MicroserviceClient /usr/
# WORKDIR /usr
USER develop
EXPOSE 50010
......
#FROM ubuntu:14.04
#FROM ubuntu-debootstrap:14.04
FROM municipalitybank.com:5050/mcx/devops/dev-cpp
USER root
COPY ./doc/install-dependencies.sh /usr/
RUN chmod +x /usr/install-dependencies.sh
RUN apt-get update
RUN /usr/install-dependencies.sh
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# setting for gcc >= 4.9.2
#RUN rm /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#COPY ./tmp/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6
# setting for shared-memory
#RUN echo kernel.shmmax=49249672960 >> /etc/sysctl.conf
#RUN echo kernel.shmall=10485760 >> /etc/sysctl.conf
# app
# COPY ./tmp/* /usr/lib/x86_64-linux-gnu/
# COPY ./bin/test_MicroserviceClient /usr/
# WORKDIR /usr
USER develop
EXPOSE 50010
# ENTRYPOINT ["/bin/bash"]
base-cpp-microservice-test:
environment:
log4cpp.console: yes
graphite_hostport: 172.16.1.244:2015
image: 172.16.1.132:5000/ipgallery/base-cpp-microservice-test
ports:
- "50010:50010"
privileged: true
\ No newline at end of file
version: '2'
services:
##### dev-microservice
dev-microservice:
image: municipalitybank.com:5050/ipgallery.common.cpp/microservice/develop
ports:
- "2000:2000"
- "50010:50010"
privileged: true
container_name: devenv
volumes:
- "./:/home/develop/project"
- "./../3party:/home/develop/3party"
command: tail -f /dev/null
networks:
- devnet
networks:
devnet:
driver: bridge
\ No newline at end of file
#!/bin/sh
# building the final docker microservice framework image
if [ -z "$1" ]
then
echo "Usage $0 [version]"
exit
fi
echo "building the base image..."
docker build -f Dockerfile.develop -t municipalitybank.com:5050/ipgallery.common.cpp/microservice/develop .
echo "run build env"
#docker-compose -f develop-compose.yml run -d --service-ports --name devenv dev-microservice bash &
docker-compose up -d dev-microservice
# wait for container tro start
sleep 5
echo "cmake generate"
docker exec -it devenv cmake .
echo "clean"
docker exec -it devenv make clean
echo "build"
# set to exit on fail
set -e
docker exec -it devenv make
echo "packaging..."
# make package
docker exec -it devenv make package
# # copy 3party libs to tmp inside project
# rm -rf ./tmp
# mkdir tmp
# docker exec -it cp `ldd build/lib/libMicroservice.so | grep 3partry | awk '{print $3}'` ./tmp/
# now copy everything to target
echo "copy and extract package.."
rm -rf ./target
mkdir target
mv Microservice-$1-Linux* ./target/
echo "build image..."
docker build -t municipalitybank.com:5050/ipgallery.common.cpp/microservice:$1 .
# closing container
docker-compose down dev-microservice
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment