how to rebuild the source code in docker after building the image and contaner?

541 views Asked by At

I need to do some tracing on DeathStarBench. It is a micro-services benchmark, that is deployed on docker. For my tracing I use lttng. Also, I have made some changes to the DeathStarBench source code to be able to perform this tracing. DeathStarBench also uses cmake. My problem here is that to be able to perform this tracing task I need to first install lttng tracer on the docker image and then rebuild the code so that the changes in the source code are applied. I am new to docker and don't really understand the workflow, but after lots of searches, I understood that with "docker build -t " I will be able to rebuild the docker image and apply the code changes, however, I encounter error while doing this because my code uses lttng/tracepoint.h (checks if lttng-ust is installed on the system prior to this), and since I am rebuilding the docker image for sure it is not yet installed and I encounter this error. Isn't there any way that enables me to first build the docker image and container and then rebuild the code and deploy it inside that container?

To explain in more detail: I tried the sample cmake tracing project in lttng-ust github and was successful to do the same this is the sample: https://github.com/lttng/lttng-ust/tree/master/doc/examples/cmake-multiple-shared-libraries

here it uses FindLttngUst.cmake I did all the same steps for my project just this method has a requirement that lttng should be previously installed in the intended machine for this to work As you know my application is deployed on top of docker I add the following to my dockerfile to install lttng when rebuilding docker images

RUN apt-get update RUN apt-get install -y git libpopt-dev uuid-dev libxml2-dev automake autoconf libtool flex
bison make libc6 libc6-dev libglib2.0-0 libglib2.0-dev libpopt-dev python-pip python-dev

#Install lttng related RUN git clone git://git.lttng.org/userspace-rcu.git RUN (cd userspace-rcu; ./bootstrap ; ./configure ; make ; make install ; ldconfig ; cd ..) RUN git clone git://git.lttng.org/lttng-ust.git RUN (cd lttng-ust; ./bootstrap ; ./configure ; make ; make install ; ldconfig; cd ..) RUN git clone git://git.lttng.org/lttng-tools.git RUN (cd lttng-tools; ./bootstrap ; ./configure ; make ; make install ; ldconfig; cd ..) #RUN git clone git:////git.lttng.org/lttng-modules.git #RUN (cd lttng-modules; make ; make install ; ldconfig; cd ..)

However when I try to rebuild the specific service image I encounter an error, which is not related to my changes at all (related to another service), so I think this is because of deployment dependencies between images Then I tried to overcome this by building all images with docker-compose up --build Again the rebuild process seems to start, but from the logs displayed I think this is not what I am looking for (because when I use "docker build -t " the log shows that build commands like make are in progress, but as I told you I face issue in this method),enter image description here however when I use "docker-compose up --build" to rebuild everything in logs I see the kind of commands in this picture Which looks like database transactions to me and takes very long to execute (I waited for 1 day and it did not finish!!!)

so here I need to know what I am doing wrong

0

There are 0 answers